Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
14277 | xingru | 判断一个数是否为质数 | C++ | 解答错误 | 0 MS | 248 KB | 208 | 2023-04-12 16:37:20 |
#include<bits/stdc++.h> using namespace std; int main() { int a,flag=0; cin>>a; for(int i=1;i<=a;i++){ if(a%i==0){ flag=1; } } if(flag=1) cout<<"no"; else cout<<"yes"; return 0; }