Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
129197 | 李馥甄 | 14判断素数III | C++ | Accepted | 2 MS | 272 KB | 294 | 2025-08-22 16:06:12 |
#include <bits/stdc++.h> using namespace std; int n; int main(){ cin>>n; if(n<2){ cout<<"NO"; return 0; } bool flag=true; for(int i=2;i<=n-1;i++){ if(n%i==0){ flag=false; break; } } if(flag==true){ cout<<"YES"; }else{ cout<<"NO"; } return 0; }