#27683: _CPP


11030067@mail.hpsh.tp.edu.tw (和平110級鄧雨珊)

學校 : 臺北市立和平高級中學
編號 : 163096
來源 : [61.64.210.174]
最後登入時間 :
2022-10-23 16:54:59

#include <iostream>
#include <cmath>
using namespace std;

int main(){
int n, x, root;
bool prime;
cin >> n;
while (n--){
cin >> x;
root=sqrt(x);
prime=true;
for (int i=2; i<=root; i++){
if (x%i==0){
prime=false;
}
}
prime ? cout <<"Y\n" : cout <<"N\n";
}
}