博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[解题报告]10110 - Light, more light
阅读量:6817 次
发布时间:2019-06-26

本文共 1431 字,大约阅读时间需要 4 分钟。

 

Light, more light

The Problem

There is man named "mabu" for switching on-off light in our University. He switches on-off the lights in a corridor. Every bulb has its own toggle switch. That is, if it is pressed then the bulb turns on. Another press will turn it off. To save power consumption (or may be he is mad or something else) he does a peculiar thing. If in a corridor there is `n' bulbs, he walks along the corridor back and forth `n' times and in i'th walk he toggles only the switches whose serial is divisable by i. He does not press any switch when coming back to his initial position. A i'th walk is defined as going down the corridor (while doing the peculiar thing) and coming back again.

Now you have to determine what is the final condition of the last bulb. Is it on or off? 

 

The Input

The input will be an integer indicating the n'th bulb in a corridor. Which is less then or equals 2^32-1. A zero indicates the end of input. You should not process this input.

The Output

Output "yes" if the light is on otherwise "no" , in a single line.

Sample Input

3624181910

Sample Output

noyesno

Sadi Khan 

Suman Mahbub 
01-04-2001

 

 

理解题意以后就是水题了,判断是否完全平方数

#include
#include
int main(){ long long a,b,c; while(scanf("%lld",&a)!=EOF&&a) { b=sqrt(a); c=b*b; if(a==c) printf("yes\n"); else printf("no\n"); } return 0;}

 

转载于:https://www.cnblogs.com/TheLaughingMan/archive/2013/02/24/2924694.html

你可能感兴趣的文章
assoc 和 ftype
查看>>
搭建mysql主从服务器
查看>>
linux下查看和修改文件时间
查看>>
我的友情链接
查看>>
linux资源分配Cgroup用法
查看>>
圆包含最多点问题
查看>>
Windows 8.1 发布了一个称为“Defender”的新模块
查看>>
浅析apache调优
查看>>
我的友情链接
查看>>
【Linux】如何正确安装Tomcat
查看>>
010-电脑软件安装手册-20190418
查看>>
linux学习笔记四(shell编程二)
查看>>
Hbase Shell 基础和常用命令
查看>>
数据结构和算法
查看>>
Linux_haproxy(3)v1.0
查看>>
Linux HA Cluster高可用集群之HeartBeat2
查看>>
C#中使用GetCursorPos获取屏幕坐标
查看>>
我的友情链接
查看>>
flume bucketpath的bug一例
查看>>
2017八款最佳反勒索软件工具
查看>>