首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
leo110
2025年5月10日 14:10
随机数 题解:无语!一直以为求5位随机数的和与剩下15位的和
P1009
回复 0
|
赞 0
|
浏览 198
#include<iostream> #include<time.h> using namespace std; int main(){ int a[21]={0},sum,index,count=0; srand(time(0)); while(true){ index=rand()%20+1;  ...
williams
2024年3月10日 10:34
随机数 题解:挑战最短代码
P1009
回复 7
|
赞 21
|
浏览 4.4k
#include <stdio.h> int main(){ printf("210"); }
赖建霖
2025年2月4日 10:38
随机数 题解:
P1009
回复 0
|
赞 4
|
浏览 1.4k
//没看懂想问什么 #include <bits/stdc++.h> using namespace std; int main() { cout << 210 << endl; return 0; }
ccccccyes
2024年8月28日 09:17
随机数 题解:
P1009
回复 0
|
赞 5
|
浏览 2.5k
//?? //实际上是1加到20 #include <iostream> using namespace std; int main(){ int sum = 0; for(int i = 1; i<=20; i++) sum += i; cout<<sum; return 0; }
Candour
2024年4月20日 20:28
随机数 题解:
P1009
回复 0
|
赞 5
|
浏览 1.6k
#include<bits/stdc++.h> using namespace std; int main() { cout << 210; return 0; }
小酒
2024年3月15日 16:29
随机数 题解:
P1009
回复 0
|
赞 8
|
浏览 2.1k
1009解题思路 #include <bits/stdc++.h> using namespace std; int main() { int sum=0; int a[105]={0}; for(int i=0;i<5;i++) { a[i]=rand()%20+1; a[5]=a[5]+a[i]; } for(int j=1;j<=20;j++) { int count=0; for(int i=0;i<5;i++) { if(j!=a[i]) count++; ...
FIVEszc
2024年3月11日 23:29
随机数 题解:C++
P1009
回复 0
|
赞 10
|
浏览 1.9k
#include <bits/stdc++.h> using namespace std; int main() { srand(time(NULL)); int i,sum=0,s=0; for(;i<5;i++) { int num=rand()%20; sum+=num; } for(i=1;i<=20;i++) s=s+i; s=s-sum; printf("%d",s); return 0; } &n...
DestinyCares+++
2024年2月29日 21:49
随机数 题解:
P1009
回复 0
|
赞 6
|
浏览 2.1k
#include<iostream> #include<string> #include<random> using namespace std; int a[21] = {0}; int b[6]; int main() { srand(time(0)); int sum = 0, ans = 0; for (int i = 0; i < 5;i++) { &...
予守
2024年2月28日 16:02
随机数 题解:
P1009
回复 0
|
赞 1
|
浏览 1.8k
低估了出题人想送分的决心
Hegel
2023年3月18日 15:19
1-20选5个数,求未被选中的数与选中的5个数之和
P1009
回复 0
|
赞 6
|
浏览 4.5k
#include <iostream> #include <random> using namespace std; int main() { srand(time(0)); int a[5],sum = 0; for(int i = 0;i<5;i++){ a[i]=rand()%20+1; sum += a[i]; } for(int i =0,j;i<=20;i++){ for(j = 0;j<5;j++) if(a[j]==i) break; if(j==5)...
1
2
题目
随机数
题解数量
19
发布题解
在线答疑
热门题解
1
随机数 题解:挑战最短代码
2
随机数 题解:C++
3
随机数 题解:
4
随机数答案(这问题应该改名叫求1+2+3+。。。+20=多少)
5
随机数 题解:
6
1-20选5个数,求未被选中的数与选中的5个数之和
7
假装这题不那么傻
8
随机数 题解:
9
随机数 题解:
10
随机数 题解: