L1-015. 跟奥巴马一起画方块(C++)

来源:互联网 发布:mac 打开多个终端 编辑:程序博客网 时间:2024/05/17 07:55

原题链接:https://www.patest.cn/contests/gplt/L1-015
这里写图片描述


我的代码:

#include <iostream>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char** argv) {    int N=0;    char C;    cin>>N>>C;    for(int i=0;i<( (N+1)/2 );i++)    {        for(int j=0;j<N;j++)        {            cout<<C;        }        cout<<endl;    }    return 0;}
0 0