<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] ### 題目: 美國總統奧巴馬不僅呼吁所有人都學習編程,甚至以身作則編寫代碼,成為美國歷史上首位編寫計算機代碼的總統。2014年底,為慶祝“計算機科學教育周”正式啟動,奧巴馬編寫了很簡單的計算機代碼:在屏幕上畫一個正方形。現在你也跟他一起畫吧! ### 輸入格式: 輸入在一行中給出正方形邊長N(3<=N<=20)和組成正方形邊的某種字符C,間隔一個空格。 ### 輸出格式: 輸出由給定字符C畫出的正方形。但是注意到行間距比列間距大,所以為了讓結果看上去更像正方形,我們輸出的行數實際上是列數的50%(四舍五入取整)。 ### 輸入樣例: 10 a ### 輸出樣例: aaaaaaaaaa a a a a a a aaaaaaaaaa ### 分析(偽代碼和知識點) ### 代碼: ``` #include <stdio.h> void test(void) { int i, j; int cnt, h; char c; scanf("%d %c", &cnt, &c); h = cnt * 10 / 2; if(h % 10 >= 5) h = cnt / 2 + 1; else h = cnt / 2; for(i = 0; i < h; i++) { if(i == 0 || i == h - 1) { for(j = 0; j < cnt; j++) printf("%c", c); } else { for(j = 0; j < cnt; j++) { if(j == 0 || j == cnt-1) printf("%c", c); else printf("%c", ' '); } } printf("\n"); } } int main(void) { test(); return 0; } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看