国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Java > 正文

HDU 2053 JAVA

2019-11-06 07:21:13
字體:
來源:轉載
供稿:網友

PRoblem Description There are many lamps in a line. All of them are off at first. A series of Operations are carried out on these lamps. On the i-th operation, the lamps whose numbers are the multiple of i change the condition ( on to off and off to on ).

Input Each test case contains only a number n ( 0< n<= 10^5) in a line.

Output Output the condition of the n-th lamp after infinity operations ( 0 - off, 1 - on ).

Sample Input 1 5

Sample Output 1 0

import java.util.*;class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ int n=sc.nextInt(); int m=(int)Math.sqrt(n); if(n==m*m){ System.out.println("1"); }else{ System.out.println("0"); } } }}
上一篇:HDU 2054 JAVA

下一篇:HDU 2052 JAVA

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 泰来县| 芦溪县| 同心县| 万宁市| 通江县| 怀柔区| 宁津县| 皋兰县| 富源县| 宜兰县| 桂平市| 隆子县| 彩票| 温泉县| 望江县| 大新县| 洛南县| 仲巴县| 灵璧县| 英吉沙县| 江达县| 浪卡子县| 南平市| 建湖县| 郓城县| 荣成市| 阿坝县| 杨浦区| 句容市| 吉林省| 腾冲县| 仪陇县| 北安市| 瑞丽市| 蓬安县| 莆田市| 沾益县| 井陉县| 湖南省| 易门县| 鄂尔多斯市|