#include<iostream> using namespace std;int main() { int n; char c; cin >> n >> c; int max = 1; int m = (n + 1) / 2; int h = 0; //计算高度和最大值 while (true) { m -= max; if (max + 2 > m) { break; } max += 2; h++; } int now = max; int num = 0; //画上半部分 for (int j = 0; j <= h; j++) { for (int i = max - now; i > 0; i -= 2) { cout << ' '; } for (int i = now; i > 0; i--) { cout << c; num++; } now -= 2; cout << endl; } //画下半部分 now = 3; for (int j = 0; j < h; j++) { for (int i = max - now; i > 0; i -= 2) { cout << ' '; } for (int i = now; i > 0; i--) { cout << c; num++; } now += 2; cout << endl; } cout << n - num << endl; return 0; }