Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main(){
- int t; cin >> t;
- while(t--){
- int n, i;
- cin >> n;
- int flag = 1;
- for(i = 2; i <= sqrt(n); i++){
- if(!(n % i)){
- flag = 0;
- break;
- }
- }
- if(flag) cout << "Yes\n";
- else cout << "No\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement