// This program builds a pyramid from asterisks
#include <iostream>
#include <string>
using namespace std;
int main(){
for(int i=1;i<=10; i++)
{
for(int j=1;j<=10-i; j++) cout <<" ";
cout << "*";
for(int j=0;j<=i-2; j++) cout <<" ";
cout << "*"<< endl;
}
return 0;
}
No comments:
Post a Comment