fork download
  1. #include <iostream>
  2. using namespace std; int main() { srand(time(NULL)); int Russia = 0; int n = 1; int num = 0; while (n != num) { if (Russia == 0) { Russia = 2222; num = rand() %9+1; cout << num << " " << n; } else if (Russia != 0) { n = rand() %10 ; cout << num << " " << n; } if (n < num) { cout << " MORE " << endl; } else if (n > num) { cout << " less "<< endl; } else if (n == num) {cout << " da "; } } system("pause"); } // guessnumberc.cpp 9-9-2019 DANILIN Russia
  3.  
Success #stdin #stdout #stderr 0.01s 5320KB
stdin
Standard input is empty
stdout
9 1 MORE 
9 7 MORE 
9 1 MORE 
9 6 MORE 
9 0 MORE 
9 1 MORE 
9 6 MORE 
9 9 da 
stderr
sh: 1: pause: not found