- chenxueze's blog
金字塔
- 2025-2-5 13:49:36 @
#include<bits/stdc++.h>
using namespace std;
int main () {
int n;
cin >> n;
for (int i = 1;i <= n; i++){
for (int j = n;j > i; j--) {
cout << " ";
}
for (int k = 1;k <= i; k++) {
cout << "*";
}
for (int l = 1;l < i; l++) {
cout << "*";
}
cout << endl;
}
return 0;
}