You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
466 B

#include <bits/stdc++.h>
using namespace std;
int main() {
//倒三角形
ios::sync_with_stdio(false); //读入输出优化的强迫症
int n;
cin >> n;
int i, j;
for (i = 1; i <= n; i++) {
//打印空格
for (j = 1; j <= (i - 1); j++) {
cout << " ";
}
//打印#
for (j = 1; j <= (2 * (n - i + 1) - 1); j++) {
cout << "#";
}
cout << endl;
}
return 0;
}