fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, t;
  6. cin >> t;
  7. while(t--) {
  8. cin >> n;
  9. int cnt=0;
  10. for(int i=1; i<=sqrt(n); i++) {
  11. if(n%i==0) {
  12. cnt++;
  13. }
  14. }
  15. if(cnt<=1) {
  16. cout << "yes" << endl;
  17. } else cout << "no" << endl;
  18. }
  19. }
Success #stdin #stdout 0s 5300KB
stdin
5
23
13
20
1000
99991
stdout
yes
yes
no
no
yes