TEST - Life, the Universe, and Everything


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:
1
2
88
42
99

Output:
1
2
88

Information

In case of any problems with your code, you can take a look in the forum, you'll find the answer, only for this problem, in various languages.


hide comments
ishanmitra1996: 2016-09-03 15:19:27

This is so freaking easy. The main code is at least 4 lines long.

bhargavjagan: 2016-09-01 21:50:09

can any one tell me what the problem actually ?
i didn't understand the question

anchises_1968: 2016-08-30 22:38:15

I finally got it. First of all, leave any comment cout out of your code (i.e. "Input: " "Output". Also, as in my previous comment, the input should stop after the first input after 42 - just like the example above.

b03902099: 2016-08-28 17:19:49

Don't order the numberQQQ

code_bard: 2016-08-28 13:48:31

There are so many errors in this question. There are no input constraints and the number of elements isn't specified.

anchises_1968: 2016-08-23 01:44:52

Yes I've been with this one for 2 weeks - off and on. From my understand -looking at the example- the input stops after the first digit after 42. Any three digit+ input gets ignored. I've initialized my array with 99 elements, maybe that's the mistake. Anyway all of submissions come back with wrong answer. Doing this in C++. Any ideas are appreciated.

akashgambitier: 2016-08-22 21:28:44

why this program statement shows that program allows taking input from user even after 42 no is taken as input

amit199205: 2016-08-21 13:31:31

my code is working correctly in codeblocks but it's saying wrong answer...i have used an array of integers for storing inputs..but don't know what is wrong..is it something related to brute-force algo?

nutharsh: 2016-08-19 18:18:32

Problem statement has ambiguity upto some extent. My assumption was to read inputs from standard input(console) integer by integer and keep printing them on standard output(say, console) till you find 42.

ayush_14: 2016-08-16 12:04:56

I sorted the data
what is wrong in that?
I stop at 42?


Added by:mima
Date:2004-05-01
Time limit:10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:Douglas Adams, The Hitchhiker's Guide to the Galaxy

Problem's scores 2 votes

Concept difficulty
Concept difficulty 6%
Implementation difficulty
Implementation difficulty 7%
369 74