#c++
#include <iostream>
using namespace std;
int main()
{
int space, rows;
cout <<"输入行数: ";
cin >> rows;
for(int i = 1, k = 0; i <= rows; ++i, k = 0)
{
for(space = 1; space <= rows-i; ++space)
{
cout <<" ";
}
while(k != 2*i-1)
{
cout << "* ";
++k;
}
cout << endl;
}
return 0;
}
#include"stdio.h"
main(){
int h,l;
for(h=1;h<=5;h++){
for(l=5;l>=h;l--){
printf(" ");
}
for(l=1;l<=2*h-1;l++){
printf("*");
}
printf("\n");
}
}