Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- int main()
- {
- int Answer = rand() % 10 + 1;
- int Guess = 0, Tries = 2;
- std::cout << "I am thinking of a number from 1 to 10\nYou must guess what it is in three tries";
- while ( Guess != Answer )
- {
- std::cout << "\n" << Answer << "\nEnter your guess: ";
- std::cin >> Guess;
- if ( Guess == Answer )
- {
- std::cout << "CORRECT!";
- std::getchar();
- }
- else if ( Guess != Answer && Tries == 0 )
- {
- std::cout << "You're a faggot.\nExiting...";
- break;
- }
- else
- {
- std::cout << "Sorry, please guess again";
- Tries -= 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement