import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int T=sc.nextInt(); for (int i =1; i <= T; i++) { int n=sc.nextInt(); int cnt=0; boolean isP=true; lo:for (int j = 2; j*j <=n; j++) { while(n%j==0) { n/=j; cnt++; if(cnt>2){ System.out.println("No"); isP=false; break lo;} } } if(isP){ if(n>1){ cnt++; if(cnt!=2){ System.out.println("No"); } else{ System.out.println("Yes"); } } else{ System.out.println("Yes"); } } } } static boolean isPri(int n){ if(n<2)return false; for (int i = 2; i*i <=n; i++) { if(n%i==0)return false; } return true; } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:1246 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:543 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:672 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:373 |
sizeof的大作用 (C语言代码)浏览:1028 |
企业奖金发放 (C语言代码)浏览:2325 |
陶陶摘苹果2 (C语言代码)浏览:601 |
整数平均值 (C语言代码)浏览:787 |
简单的a+b (C语言代码)浏览:416 |
1197求助浏览:631 |