(挑战编程_7_1)Light, more light
来源:互联网 发布:手机怎样看淘宝的积分 编辑:程序博客网 时间:2024/05/01 15:22
http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110701&format=html
#include <iostream>#include <cstdlib>#include <vector>#include <set>#include <string>#include <cstring>#include <fstream>#include <cassert>#include <cmath>using namespace std;//#define _MY_DEBUG_/*MainStructure: 主结构*/void MainStructure();/*Process*/void Process();/*判断最后一盏灯是开还是关:开:true关:false*/bool IsOpen(unsigned num);int main(){MainStructure();return 0;}void MainStructure(){#ifdef _MY_DEBUG_string inputStr = "C:/Users/cao/Desktop/算法/要看的书/算法/2挑战编程/input/1.inp";//string inputStr = "D:/2挑战编程/input/110205.inp";string outputStr = "C:/Users/cao/Desktop/算法/要看的书/算法/2挑战编程/input/1.outp";ifstream fin;fin.open(inputStr);cin.rdbuf(fin.rdbuf());/*ofstream fout;fout.open(outputStr.c_str());cout.rdbuf(fout.rdbuf());*/#endifProcess();}void Process(){unsigned num = 0;while (cin >> num){if (num == 0){break;}if (IsOpen(num)){cout << "yes" << endl;}else{cout << "no" << endl;}}}bool IsOpen(unsigned num){unsigned sNum = (int)sqrt(double (num));if (sNum *sNum == num){return true;}return false;}
- (挑战编程_7_1)Light, more light
- uva 10110 Light, more light (数论)
- Light,More Light
- 10110 - Light, more light
- 10110 - Light, more light
- 10110 - Light, more light
- 10110 - Light, more light
- UVa10110 Light, more light
- Light, more light
- Light, more light UVA10110
- 110701 Light, more light
- 10110 - Light, more light
- Light, more light - PC110701
- 10110 - Light, more light
- Light, more light
- uva 10110 Light, more light
- uva 10110 - Light, more light
- UvaOJ 10110 - Light, more light
- poj1700andpoj3404
- 合唱队列
- (DP)最大子段和问题分析和总结(…
- poj1050(DP)
- poj1159(回文字串)
- (挑战编程_7_1)Light, more light
- poj1163(DP)and3176(DP)多串的…
- poj2533(DP)(与杭电1257一模一…
- jq-手机-图片大小
- 木兰花令——纳兰性德
- HDOJ2602(DP0-1背包)
- poj1742andHDOJ2844(DP多重背包)
- poj1276(DP多重背包)
- 真语