【CodeChef】 Life, the Universe, and Everything
2016-02-28 10:44
405 查看
Problem here
All submissions for this problem are available.
For help on this problem, please check out our tutorial Input and Output (I/O)
2
88
42
99
2
88
All submissions for this problem are available.
For help on this problem, please check out our tutorial Input and Output (I/O)
Problem
Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely… rewrite small numbers from input to output. Stop processing input after reading in the number 42. All numbers at input are integers of one or two digits.Example
Input:
12
88
42
99
Output:
12
88
Solution
#include <iostream> using namespace std; int main() { int n; while(cin >> n){ if(n == 42){ break; } cout << n << endl; } return 0; }
相关文章推荐
- 【CodeChef】Holes in the text
- codechef Code 2014 GRID,CLOCK
- cc_julychallenge2014
- CodeChef SIGNWAVE (打表找规律)
- codechef Mike and Stamps
- codechef May challenge C
- codechef July Challenge 2014
- codechef December Challenge 2014
- Codechef September Challenge 2015
- Codechef November Challenge 2015 Simple Sum
- CodeChef January Long Challenge 2016 - SEAKAM
- codechef February Challenge 2016
- CodeChef - Small factorials
- 【CodeChef】LCH15JGH Many bananas
- 【CodeChef-PARSIN】Sine Partition Function【矩阵乘法】【DP】
- CodeChef Add or Multiply 【思维】
- CodeChef JUNE17 - Chef and Prime Queries
- CodeChef - GRAPHCT Graph Counting+
- 字典树 Robot Game CodeChef - TR2
- CodeChef Counting important pairs