Advertisement
ivanshir

Untitled

Jul 5th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include "iostream"
  2. #include "cstdlib"
  3. #include "ctime"
  4.  
  5. using namespace std;
  6. int main()
  7. {
  8. srand(time(0));
  9. long long rnd, min, max;
  10. char action;
  11. min = 1;
  12. max = 10000000000;
  13. do
  14. {
  15. rnd = rand() % (max - min + 1) + min;
  16. cout << rnd << "\n";
  17. cin >> action;
  18. if(action == '=')
  19. {
  20. break;
  21. }
  22. if(action == '>' && rnd > min)
  23. {
  24. min = rnd;
  25. }
  26. if(action == '<' && rnd < max)
  27. {
  28. max = rnd;
  29. }
  30. }
  31. while(true);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement