Guest User

Untitled

a guest
Sep 25th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <ctime>
  3. #include <iostream>
  4.  
  5. #define LOG(c) std::cout << c << std::endl
  6.  
  7. int main()
  8. {
  9. srand(time(0));
  10. LOG("Guess number from 0 to " << RAND_MAX);
  11.  
  12. int number;
  13. std::cin >> number;
  14. int answer = rand();
  15. if (number == answer) {
  16. LOG("You are lucky");
  17. } else {
  18. LOG("You are loser, sorry. My number is " << answer);
  19. }
  20. }
Add Comment
Please, Sign In to add comment