Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
91358 | 谢绍澜 | 判断素数 | C++ | Wrong Answer | 1 MS | 272 KB | 286 | 2024-09-21 16:47:21 |
#include<iostream> #include<cmath> using namespace std; int a(int x){ for(int i=2;i<x-1;i++){ if(x%i==0) return 0; } return 1; } int main(){ int n; cin>>n; if(a(n)==0) cout<<"No"; else cout<<"Yes"; }
------Input------
1
------Answer-----
No
------Your output-----
Yes