#include <iostream>
using namespace std;
int main() {
for(int i = 1; i <= 5; i++) {
for(int j = 5 - i; j > 0; j--)
cout << ' ';
for(int j = i * 2 - 1; j > 0; j--)
cout << '*';
cout << endl;
}
for(int i = 1; i <= 4; i++) {
for(int j = i; j > 0; j--)
cout << ' ';
for(int j = 9 - 2 * i; j > 0; j--)
cout << '*';
cout << endl;
}
return 0;
}
C++大学教程(第九版) 第5章练习题 5.23 星号组成的菱形图案
最新推荐文章于 2023-01-22 23:08:48 发布