#include<iostream>
#include<time.h>
#include<stdlib.h>
using namespace std;
int main(){
srand((unsigned int)time(NULL));
int a=rand()%100+1;
cout<<"a="<<a;
return 0;
}
C++产生随机数
最新推荐文章于 2025-04-25 12:52:41 发布
#include<iostream>
#include<time.h>
#include<stdlib.h>
using namespace std;
int main(){
srand((unsigned int)time(NULL));
int a=rand()%100+1;
cout<<"a="<<a;
return 0;
}