习题2-3
程序员文章站
2022-06-25 20:45:17
...
#include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j < i; j++) {
cout << " ";
}
for (int k = 0; k <2 * (n - i ) + 1; k++)
{
cout << "# " ;
}
cout << endl;
}
return 0;
}