UVA10110 Light, more light
生活随笔
收集整理的這篇文章主要介紹了
UVA10110 Light, more light
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
鏈接地址。
分析:
如果n能被a整除,那么一定存在一個b使得a*b = n。開關經兩次變化相當于沒有變化。那么只要看a = b的那種特殊情況就OK了。
#include <stdio.h> #include <math.h> #include <stdlib.h>int main(){unsigned n, k;while(scanf("%d", &n) == 1 && n){k = (int)sqrt(n*1.0);if(k*k == n){printf("yes\n");}else printf("no\n");}return 0; }
?
轉載于:https://www.cnblogs.com/tanhehe/archive/2013/04/02/2995329.html
總結
以上是生活随笔為你收集整理的UVA10110 Light, more light的全部內容,希望文章能夠幫你解決所遇到的問題。