Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <windows.h>
- using namespace std;
- int menu();
- int main()
- {
- int answer=menu();
- switch (answer)
- {
- case 0: cout<<"1"<<endl;break;
- case 1: cout<<"2"<<endl;break;
- case 2: cout<<"3"<<endl;break;
- case 3: cout<<"4"<<endl;return 0;
- }
- system("pause");
- return 0;
- }
- int menu() {
- int key=0;
- int code;
- do {
- system("cls");
- key=(key+4)%4;
- if (key==0) cout<<"-> Privet +1"<<endl;
- else cout<<" Privet +1"<<endl;
- if (key==1) cout<<"-> Privet +2"<<endl;
- else cout<<" Privet +2"<<endl;
- if (key==2) cout<<"-> Privet +3"<<endl;
- else cout<<" Privet +3"<<endl;
- if (key==3) cout<<"-> Privet +4"<<endl;
- else cout<<" Privet +4"<<endl;
- code=getch();
- if (code==224)
- {
- code=getch();
- if (code==80) key++;
- if (code==72) key--;
- }
- }while(code!=13);
- system("cls");
- return key;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement