C++ 字符图形:星号梯形绘制 - 入门级教程
#include
int main() { int N; cin >> N;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N - i - 1; j++) {
cout << ' ';
}
for (int j = 0; j < 2 * i + 1; j++) {
cout << '*';
}
cout << endl;
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/qiOZ 著作权归作者所有。请勿转载和采集!