Advertisement
Guest User

Untitled

a guest
Dec 11th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <windows.h>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int a;
  10. int d;
  11. int liczba;
  12.  
  13.  
  14. main()
  15. {
  16.  
  17. srand(time(NULL));
  18. liczba=rand()%2+1;
  19. system("cls");
  20. cout<<"Witaj w grze papier, kamien, nozyce "<<" \nNacisnij 1 aby przejsc dalej "<<endl;
  21.  
  22. cin>>d;
  23. while(d==1)
  24. {
  25. if (d==1) {
  26. cout<<"\n1.Nozyce"<<endl;
  27. cout<<"\n2.Papier"<<endl;
  28. cout<<"\n3.Kamien"<<endl;
  29. }
  30. else cout<<"\nWybrales zla opcje sproboj ponownie"<<endl;
  31.  
  32.  
  33. cout<<"\nWybierz opcje "<<endl;
  34. cin>>a;
  35. if (a==1 && liczba==3) cout<<"\nPrzegrales sproboj ponownie"<<"\n----------------------------------------------------"<<endl;
  36. if (a==1 && liczba==2) cout<<"\nGratulacje! Wygrales.Sprawdz sie jeszcze raz"<<"\n----------------------------------------------------"<<endl;
  37. if (a==2 && liczba==1) cout<<"\nPrzegrales sproboj ponownie"<<"\n----------------------------------------------------"<<endl;
  38. if (a==2 && liczba==3) cout<<"\nGratulacje! Wygrales.Sprawdz sie jeszcze raz"<<"\n----------------------------------------------------"<<endl;
  39. if (a==3 && liczba==1) cout<<"\nGratulacje! Wygrales.Sprawdz sie jeszcze raz"<<"\n----------------------------------------------------"<<endl;
  40. if (a==3 && liczba==2) cout<<"\nPrzegrales sproboj ponownie"<<"\n----------------------------------------------------"<<endl;
  41.  
  42. }
  43.  
  44.  
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement