Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- string wybor;
- int wynik = 0;
- cout << "orzel czy reszka?" << endl;
- cin >> wybor;
- wynik = rand()%2;
- if(wybor == "orzel" && wynik == 1)
- {
- cout<<"Wypadl orzel gratulacje!";
- }
- else if(wybor == "orzel" && wynik == 0)
- {
- cout<<"Wypadla reszka przykro mi :(";
- }
- if(wybor == "reszka" && wynik == 0)
- {
- cout<<"Wypadla reszka gratulacje!";
- }
- else if(wybor == "reszka" && wynik == 1)
- {
- cout<<"Wypadl orzel przykro mi :(";
- }
- // Nie wypadla mi ani razu np reszka 5 razy z rzêdu dlatego jest to pseudolosowoœæ
- return 0;
- }
Add Comment
Please, Sign In to add comment