Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
57560 | lixinyu | 判断一个数是否为质数 | C++ | Accepted | 0 MS | 244 KB | 212 | 2024-11-24 14:06:50 |
#include<bits/stdc++.h> using namespace std; int main() { int a,n=1; cin>>a; for(int i=2;i<a;i++){ if(a%i==0){ n=i; break; } } if(n==1) cout<<"yes"; else cout<<"no"; return 0; }