Advertisement
dzieciol

wysrodkowana piramida z gwiazdek

Oct 6th, 2014
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  3. using namespace std;
  4. int main(int argc, char** argv) {
  5. /*  cout<<"#";*/
  6. int i,j,h,a,x;
  7. cout<<"podaj wysokosc";
  8. cin>>h;
  9. x=h;
  10. for(j = 0; j < (h*2); j=j+2)
  11. {for(a=1 ;a<x;a++)
  12. cout<<" ";
  13.     for(i = 0; i <= j; i++)
  14.    
  15.     cout << "#";
  16.     x--;
  17.     cout << endl;}
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement