您的位置:首页 > 编程语言

1036. 跟奥巴马一起编程(15)

2017-10-22 01:17 281 查看
水~

// 2017/10/14 NCU
// PAT-B 1053
// scienceZ
#include <cstdio>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;

int n;
char c;
int main()
{
cin >> n >> c;
int a = n, b = round(float(n)/2);
for (int i = 1; i<=b; i++){
for (int j = 1; j<=a; j++){
if (i==1 || i==b || j==1 || j==a) cout << c;
else cout << ' ';
}
cout << endl;
}

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: