为什么我数不出结果啊
#include <stdio.h>#include <math.h>
int p(int s)
{
if((int)sqrt((double)s)*(int)sqrt((double)s)==s)
return 1;
else return 0;
}
main()
{
/* int n;
scanf("%d",&n);
if(p(n)==1)
printf("%d",n);
else
printf("usb");
}
*/ int a[100];
int count=0,i;
while(1){
scanf("%d",&a[i]);
if(p(a[i])==1)
count++;
if(a[i]==0)
break;
}
printf("%d",count);
}