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
vepagautam: 2015-01-20 03:21:05

The question is not clear!! I understand that stop processing input after reading in the number 42. But what is the cue to stop entering numbers?? Is it that only one number can be entered after inputing 42?

Abhishek: 2015-01-20 03:21:05

what is wrong with it .
i have submitted the correct program.it is running in my pc still here compiler is showing compilation error. And sometimes when i don't get compilation error it shows wrong output when the program runs fine on my pc on turbo c++ compiler.Can anybody help me??

..........: 2015-01-20 03:21:05

can anyone give me more inputs so that i can check my code more precisely

Pankaj Kumar: 2015-01-20 03:21:05

Don't forget return 0 and print next line after every output.
Also select the right compiler before submitting.

sumit: 2015-01-20 03:21:05

my output is coming correctly in my pc and ideone.com compiler.Can anyone please tell me why SPOJ comiler says "Wrong ans"?
Did i able to understand the problem properly???

Last edit: 2013-06-09 12:25:41
vinod kumar: 2015-01-20 03:21:05

what is wrong with it .
i have submitted the correct program.it is running in my pc still here compiler is showing compilation error.could anybody help me why so?

Keerti: 2015-01-20 03:21:05

can't i enter the no. of numbers to be given in this program?

secret: 2015-01-20 03:21:05

I am getting wrong answer in spoj though the same code is giving right answer in ideone.Please help me out.

Tobias B.: 2015-01-20 03:21:05

Haha it's so stupid, you have to print a newline after each number. And don't forget to return 0;

Rafi Ahmad: 2015-01-20 03:21:05

why my program show run time error bt its gives correct ourput? can anyone help me?


Added by:mima
Date:2004-05-01
Time limit:1s
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%
375 74