Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
4711 | 李伟和 | 13判断质数 | C++ | Wrong Answer | 3 MS | 256 KB | 428 | 2024-09-07 16:02:03 |
#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