Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- string vystup_x, vystup_1, vystup_2;
- vystup_1="_";
- int a = 0;
- cout << "Zadejte pocet schodu A:" << endl;
- int pocet;
- cin >> pocet;
- if ((!cin.fail())&& (pocet>=0))
- {for (a; a<=pocet; a++)
- {if (a==1){
- cout << vystup_1 << endl;
- }
- else
- vystup_x = "X" + vystup_x;
- vystup_2 = vystup_x + vystup_1;
- cout << vystup_2 << endl;
- }
- }
- else cout << "Spatny vstup." << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment