Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
4710 | 李伟和 | 13判断质数 | C++ | Wrong Answer | 0 MS | 264 KB | 433 | 2024-09-07 16:01:04 |
#include <iostream> using namespace std; int main(){ int n, a = 0; cin >> n; if (n <= 1) { cout << "NO"; return 0; } for(int i = 2; i <= n; i++){ if(n % i == 0){ a++; if (a > 1) break; } } if(a == 1){ cout << "YES"; } else { cout << "NO"; } return 0; }
------Input------
560
------Answer-----
No
------Your output-----
NO