Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cstdio>
- using namespace std;
- int main()
- { int i,j,a,n;
- char star[]= "OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO";//
- for( i=30,j=0; i>0 ;i=i-1,j=j+2)//change i to get different size of pyramid
- { n=i;
- for(a=0;a<j+1;a++)
- {
- printf("%*c",n,star[a]);
- n=0;
- }
- cout<<endl;
- }
- }
Add Comment
Please, Sign In to add comment