Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7643 | 邓小龙 | 13判断质数 | C++ | Accepted | 3 MS | 260 KB | 340 | 2025-05-10 19:30:55 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,s=0; cin>>n; for(int i=n-1;i>=2;i--){ if (n%i==0){ s=s+1; break;//中断,结束当前循环 } } if (s>0){ cout<<"No"<<endl; } if (s==0){ cout<<"Yes"<<endl; } return 0; }