1 solutions
-
2
//我是奶龙 #include <bits/stdc++.h> using namespace std; bool su(int x) { for (int i = 2; i <=sqrt(x); i++) { if (x % i == 0) { return 1; } } return 0; } int n; int main() { cin >> n; if(n<2){ cout<<"N"; return 0; } if (su(n)) { cout << "N"; } else { cout << "Y"; } return 0; }
- 1
Information
- ID
- 230
- Time
- 1000ms
- Memory
- 64MiB
- Difficulty
- 6
- Tags
- # Submissions
- 177
- Accepted
- 50
- Uploaded By