社区讨论
90求助
P1375小猫参与者 3已保存回复 4
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 4 条
- 当前快照
- 1 份
- 快照标识符
- @m4v74if2
- 此快照首次捕获于
- 2024/12/19 18:45 去年
- 此快照最后确认于
- 2025/11/04 12:38 4 个月前
CPP
#include<iostream>
#include<cstdlib>
#include<ctime>
const int MAXN=214748364;
using namespace std;
int a[MAXN];
void fill_randint(int a[],int cnt){//插入cnt个随机数到数组a
for(int i=1;i<=cnt;i++){
a[i]=rand();
}
}
int randint(int n){
return (rand()%(n+1));
}
int main(){
srand((unsigned)time(NULL));
fill_randint(a,100000);
cout<<randint(10);
return 0;
}
回复
共 4 条回复,欢迎继续交流。
正在加载回复...