Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
126691 | 罗嘉为 | 判断质数 | C++ | 编译错误 | 0 | 0 MS | 0 KB | 314 | 2024-01-24 16:56:26 |
#include <bits/stdc++.h> using namespace std; bool is(int x){ if(x < 2){ return false; } for(int i = 2; i * i <= x; i++){ if(x % i == 0){ return false; } } return true } int main(){; int x; cin >> x; if(is(x)){ cout << "Yes"; } else { cout << "No"; } return 0; }