Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void rysuj(int h, int hP)
  6. {
  7. if(h!=0) cout<<"|";
  8. if(h>hP/2)
  9. {
  10. for(int i=0;i<hP-h;i++)
  11. {
  12. cout<<" ";
  13. }
  14. cout<<"\\"<<endl;
  15. rysuj(h-1,hP);
  16. }
  17. else if(h<=hP&&h!=0)
  18. {
  19. for(int i=0;i<h-1;i++)
  20. {
  21. cout<<" ";
  22. }
  23. cout<<"/"<<endl;
  24. rysuj(h-1,hP);
  25. }
  26. }
  27.  
  28. int main()
  29. {
  30. int wysokosc=10,wysokoscP=wysokosc;
  31. rysuj(wysokosc,wysokoscP);
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement