rt,为什么这每次都生成41
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define For(i, n) for (int i = 0; i < (n); i++)
const int MOD = 1e9 + 7;
const int N = 1e6 + 10;
const int INF = 0x3f3f3f3f;
signed main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
time(NULL);
int ran = rand() % 100;
int user, cnt = 0;
cout << "statue >>> ";
cin >> user;
while (user != ran) {
if (user > ran) {
cout << "bigger" << endl;
cout << "statue >>> ";
cin >> user;
} else if (user < ran) {
cout << "smaller" << endl;
cout << "statue >>> ";
cin >> user;
}
cnt++;
}
cout << "right! you tried " << cnt << " times" << endl;
return 0;
}