#include
using namespace std;
int main(){
//生成随机数
// rand()%100生成09999+1即1~100
//rand()%100+1生成0+1
int num = rand() % 100 + 1;
cout<<num<<endl;
system("pause");
return 0;
}
#include
using namespace std;
int main(){
//生成随机数
// rand()%100生成09999+1即1~100
//rand()%100+1生成0+1
int num = rand() % 100 + 1;
cout<<num<<endl;
system("pause");
return 0;
}
#include<stdlib.h> 要用rand加上这个头文件 有帮助的话麻烦采纳一下