Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
92965 | 吴彦晓 | 素数判断 | C++ | Accepted | 1 MS | 272 KB | 213 | 2024-10-07 14:23:50 |
#include<bits/stdc++.h> using namespace std; int main() { int a,cnt=0; cin>>a; for(int i=1;i<=a;i++){ if(a%i==0){ cnt++; } } if(cnt == 2){ cout<<"prime"; }else{ cout<<"not prime"; } }