zoukankan      html  css  js  c++  java
  • 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;
    }
  • 相关阅读:
    第三次jsp作业
    快速排列 使用链表
    Cross
    题目
    ranch
    robot
    Mold
    Mold2
    OX_pattern
    KSC sort
  • 原文地址:https://www.cnblogs.com/tanhehe/p/2995329.html
Copyright © 2011-2022 走看看