<分区>
我刚刚用 C++ 编写了下面的代码,但我遇到了一个问题:出现的随机数始终相同..!! 这是我的代码和屏幕截图:
#include <iostream>
using namespace std;
int main() {
cout << "I got a number in my mind... can you guess it?" << endl;
int random;
random = rand() % 20 + 1;
cout << random << endl;
system("pause");
return 0;
}