Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
139 | 邓小龙 | 判断素数 | C++ | Wrong Answer | 0 MS | 264 KB | 394 | 2022-07-21 09:28:57 |
# include<iostream> #include<cmath> using namespace std; bool sushu(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>>n; if(sushu(n)) cout<<"是素数"; else cout<<"不是素数"; return 0; }
------Input------
1
------Answer-----
No
------Your output-----
不是素数