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 k = 0; k < 2 * i + 1; k++) {
cout << '*';
}
cout << endl;
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/qiNo 著作权归作者所有。请勿转载和采集!