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

If you have some troubles with your code, you can take a look in the forum, you'll find the answer, only for this problem, in various languages.


Added by:Michał Małafiejski
Date:2004-05-01
Time limit:10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel Pentium G860 3GHz)
Languages:All except: SCM chicken
Resource:Douglas Adams, The Hitchhiker's Guide to the Galaxy

hide comments
mattcroth: 2015-06-30 05:13:30

this problem is terrible, it doesn't tell you at all how the data is entered in

hussain_786: 2015-06-23 13:05:58

the program is running correctly on my computer but i am getting this error during after submitting:
prog.cpp:9: error: expected constructor, destructor, or type conversion before '=' token
prog.cpp:10: error: expected unqualified-id before 'while'

please help i am new programmer and where can i find the solution code?

Last edit: 2015-06-23 13:07:08
amit_s95: 2015-06-22 14:53:35

finally found the answer to life, this universe, and as a matter of fact, everything. ;)

gvc007: 2015-06-19 19:42:42

Does my submission file need any input or are there any api through which we get input

uptoyou: 2015-06-19 09:47:12

easy one, AC in first go

hayatilelah: 2015-06-19 09:33:12

easy :)

Aditya : 2015-06-19 05:43:30

Please delete this code from here
Sorry for that

Last edit: 2015-06-19 05:44:22
mohseen: 2015-06-15 12:30:09

It is simple problem, take input using scanf in C :)

sas_2: 2015-06-13 17:48:27

can it be done with getch() in turbo c++.

look4ramesh: 2015-06-07 19:56:31

how many input shall I take??


Problem's scores 2 votes

Concept difficulty
Concept difficulty 3%
Implementation difficulty
Implementation difficulty 4%
67 15