首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
2568715672
2026年3月18日 20:32
判断素数 题解:
P1013
回复 0
|
赞 2
|
浏览 108
#include <bits/stdc++.h> using namespace std; bool is(int n){ if(n<=1) return false; else if(n==2) return true; else if(n%2==0) return false; else{ for(int i=2;i<...
ZeroQi_404
2026年3月14日 23:51
判断素数 题解:
P1013
回复 0
|
赞 8
|
浏览 107
#include <iostream> using namespace std; bool isPrime(int x){ if(x < 2) return false; for(int i = 2; i * i <= x; i++){ if(x % i == 0) return false; } return true; } int main(){ int n; cin >> n; while(!isPrime(n)){ n++; } cout <&...
太一
2026年3月11日 23:15
判断素数 题解:
P1013
回复 0
|
赞 4
|
浏览 170
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; int main() { int n, index = 0, num = 0; cin >> n; if (n == 1) { cout ...
太一
2026年3月11日 23:15
判断素数 题解:
P1013
回复 0
|
赞 0
|
浏览 44
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; int main() { int n, index = 0, num = 0; cin >> n; if (n == 1) { cout ...
太一
2026年3月11日 23:15
判断素数 题解:
P1013
回复 0
|
赞 1
|
浏览 62
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; int main() { int n, index = 0, num = 0; cin >> n; if (n == 1) { cout ...
太一
2026年3月11日 23:15
判断素数 题解:
P1013
回复 0
|
赞 0
|
浏览 45
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; int main() { int n, index = 0, num = 0; cin >> n; if (n == 1) { cout ...
Jinx_K
2026年3月10日 22:33
判断素数 题解:sqrt+n/2+corner case=AC
P1013
回复 0
|
赞 0
|
浏览 85
#include <bits/stdc++.h> using namespace std; int issu(int n) { int t=sqrt(n); int flag=1;//judgement for(;t<n/2+1;t++) if(n%t==0) { flag=0; break; } return flag; } int main() { int n; cin>>n; if(n<=1) cout<<"2"<<endl; el...
HKX9XAS
2026年3月7日 17:45
判断素数 题解:C语言的递归实现;
P1013
回复 0
|
赞 5
|
浏览 135
#include <stdio.h> int Determine(int num){ if(num<=2){ //小于等于2时返回最小素数2; return 2; } &nbs...
uly
2026年3月5日 12:35
判断素数 题解:
P1013
回复 0
|
赞 6
|
浏览 151
#include <bits/stdc++.h> using namespace std; bool is_su(int n) { if (n==1) { return false; } for (int i=2; i<=sqrt(n); i++) { if (n%i == 0) { return false; } } return true; } int main() { int n; cin>...
bro
2026年2月17日 23:57
判断素数 题解: c++
P1013
回复 0
|
赞 4
|
浏览 187
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; if(n == 1){ cout << 2 << endl; return 0; } if(n == 2){  ...
1
2
3
...
6
题目
判断素数
题解数量
54
发布题解
在线答疑
热门题解
1
【C语言】看了很多,感觉代码太麻烦,可以参考我的
2
判断素数 题解:
3
判断素数 题解:素数定义+清晰思路
4
判断素数 题解:素数定义+枚举
5
判断素数 题解:
6
判断素数 题解:
7
判断素数 题解:
8
判断素数 题解:
9
判断素数 题解:
10
判断素数 题解: