Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <ctime>
- #include <iostream>
- #define LOG(c) std::cout << c << std::endl
- int main()
- {
- srand(time(0));
- LOG("Guess number from 0 to " << RAND_MAX);
- int number;
- std::cin >> number;
- int answer = rand();
- if (number == answer) {
- LOG("You are lucky");
- } else {
- LOG("You are loser, sorry. My number is " << answer);
- }
- }
Add Comment
Please, Sign In to add comment