#include<iostream>
using namespace std;
int main() {
int n;
cout << "请输入一个正整数";
cin >> n;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= 30; j++)
cout << ' ';
for (int j = 1; j <= n - 2 * i; j++)
cout << ' ';
for (int j = 1; j < 2 * i - 1; j++)
cout << "*";
cout << endl;
}
for (int i = 1; i <= n - 1; i++){
for (int j = 1; j <= 30; j++)
cout << ' ';
for (int j = 1; j <= n - 1 - 2 * i; j++)
cout << "*";
cout << endl;
}
return 0;
}
第10题
最新推荐文章于 2024-04-14 16:34:28 发布