Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
90804 | 罗迎甲 | 13判断质数 | C++ | Wrong Answer | 0 MS | 268 KB | 274 | 2024-09-16 16:46:25 |
#include<bits/stdc++.h> using namespace std; int main() { int v,n; bool a=true; cin>>n; if(n==2) a=true; else for(int b=2;b<=n;b++){ if(n%b==0){ a=false; break; } } if(a=false)cout<<"NO"; if(a=true)cout<<"YES"; return 0; }
------Input------
157
------Answer-----
Yes
------Your output-----
YES