#include <stdio.h>
#include <math.h>
#include <stdbool.h>
bool is_Psquare(long x) {
long root = (long) (floor(sqrt(x) + 0.5));
return root * root == x;
}
int main()
{
long x;
while(1){
scanf("%ld",&x);
if(x==0)
break;
if(is_Psquare(x)){
puts("yes");
}else{
puts("no");
}
}
return 0;
}
#include <math.h>
#include <stdbool.h>
bool is_Psquare(long x) {
long root = (long) (floor(sqrt(x) + 0.5));
return root * root == x;
}
int main()
{
long x;
while(1){
scanf("%ld",&x);
if(x==0)
break;
if(is_Psquare(x)){
puts("yes");
}else{
puts("no");
}
}
return 0;
}
No comments:
Post a Comment