#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int k,c,num,space=1;
cout<<"How many rows do you want ? ";
cin>>num;
space=num-1;
for(k=1;k<=num;k++)
{
for(c=1;c<=space;c++)
{
cout<<" ";
}
space--;
for(c=1;c<=space;c++)
{
cout<<"*";
}
cout<<endl;
}
getch();
return 0;
}
No comments:
Post a Comment