L1-015. 跟奥巴马一起画方块

题目地址:https://www.patest.cn/contests/gplt/L1-015

思路:简单

注意点:无

 1 #include<stdio.h>
 2 int main()
 3 {
 4     int N,n;
 5     char C;
 6     scanf("%d %c",&N,&C);
 7     if(N>=3 && N<=21)
 8     {
 9         if(N%2==0) n=N/2;   //四舍五入 
10         else n=N/2+1;
11         for(int j=0;j<n;j++)  //
12         {
13         for(int i=0;i<N;i++) printf("%c",C);  //
14         printf("\n");
15         }  
16     }  
17     return 0;
18  } 

 

posted @ 2018-01-18 13:20  爱你的笑  阅读(332)  评论(0编辑  收藏  举报