标签:
1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<math.h> 4 bool judge(int a) 5 { 6 int sqr=sqrt(a*1.0); 7 for(int i=2 ; i<=sqr+1 ; ++i) 8 { 9 int tmp=i*i; 10 if(a%tmp==0) 11 return 1; 12 } 13 return 0; 14 } 15 16 int main(int argc, int *argv []) 17 { 18 int in=0; 19 while(scanf("%d",&in)!=EOF) 20 { 21 if(in==0) 22 return 0; 23 if(1==judge(in)) 24 printf("Yes\n"); 25 else 26 printf("No\n"); 27 } 28 return 0; 29 }
标签:
原文地址:http://www.cnblogs.com/Evence/p/4448159.html