ACM
[Accept] 10110 Light, more light
ssuk1010
2009. 6. 2. 21:05
반응형
I got accept from Judge Server.
----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
#include <stdio.h> #include <math.h> int main(void) { unsigned long number, i, light=OFF; unsigned long maxNum = (unsigned long)(pow((double)2,(double)32)-1); while( scanf("%u", &number) && number ) { if( number > maxNum ){ //printf("!!! %u\n", number); return 0; } light = (unsigned long)sqrt(number); if( light*light == number ) printf("yes\n"); else printf("no\n"); light = OFF; } return 0; } |
반응형