//需要一定的数学知识:
//这个题目就是让求 最后一个数的因子的个数是奇数还是偶数
//如果为偶数那么yes 否则 no
//当一个数为某个数的平方时,则它的因子个数为奇数
//相反当一个数不为某个数的平方时,它的因子个数为偶数。\
#include<stdio.h>
#include<math.h>
int main()
{
unsigned int n;
while(scanf("%d",&n),n)
{
int test=(int)sqrt(n);
// printf("%d\n",test*test);
if(test*test==n)
printf("yes\n");
else
printf("no\n");
}
return 0;
}
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=35&page=show_problem&p
最新推荐文章于 2022-12-23 00:12:20 发布