fojtasd

Untitled

Oct 21st, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. string vystup_x, vystup_1, vystup_2;
  8. vystup_1="_";
  9. int a = 0;
  10. cout << "Zadejte pocet schodu A:" << endl;
  11. int pocet;
  12. cin >> pocet;
  13. if ((!cin.fail())&& (pocet>=0))
  14. {for (a; a<pocet; a++)
  15. {if (a==1){
  16. cout << vystup_1 << endl;
  17. }
  18. else
  19. vystup_x = "X" + vystup_x;
  20. vystup_2 = vystup_x + vystup_1;
  21. cout << vystup_2 << endl;
  22. }
  23. }
  24.  
  25. else cout << "Spatny vstup." << endl;
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment