Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- #include <windows.h>
- using namespace std;
- int a;
- int d;
- int liczba;
- main()
- {
- srand(time(NULL));
- liczba=rand()%2+1;
- system("cls");
- cout<<"Witaj w grze papier, kamien, nozyce "<<" \nNacisnij 1 aby przejsc dalej "<<endl;
- cin>>d;
- while(d==1)
- {
- if (d==1) {
- cout<<"\n1.Nozyce"<<endl;
- cout<<"\n2.Papier"<<endl;
- cout<<"\n3.Kamien"<<endl;
- }
- else cout<<"\nWybrales zla opcje sproboj ponownie"<<endl;
- cout<<"\nWybierz opcje "<<endl;
- cin>>a;
- if (a==1 && liczba==3) cout<<"\nPrzegrales sproboj ponownie"<<"\n----------------------------------------------------"<<endl;
- if (a==1 && liczba==2) cout<<"\nGratulacje! Wygrales.Sprawdz sie jeszcze raz"<<"\n----------------------------------------------------"<<endl;
- if (a==2 && liczba==1) cout<<"\nPrzegrales sproboj ponownie"<<"\n----------------------------------------------------"<<endl;
- if (a==2 && liczba==3) cout<<"\nGratulacje! Wygrales.Sprawdz sie jeszcze raz"<<"\n----------------------------------------------------"<<endl;
- if (a==3 && liczba==1) cout<<"\nGratulacje! Wygrales.Sprawdz sie jeszcze raz"<<"\n----------------------------------------------------"<<endl;
- if (a==3 && liczba==2) cout<<"\nPrzegrales sproboj ponownie"<<"\n----------------------------------------------------"<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement