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