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
frissky: 2022-07-19 14:09:36

Accept it till while loop is true and break the loop the moment you get the value of x=42, you are done.

bilgvn8: 2022-07-18 05:43:56

wtf is this xd

blaz3mar1n: 2022-07-10 11:21:00

i have a solution in O(n log n) but i am getting tle pls help i am using html

kindallcrown: 2022-06-27 04:28:07

Wth what I/O is it?

twilysparkle: 2022-04-19 15:26:46

Guys it's literally as easy it appears to be. Just accept input numbers until you get 42, and then print all the numbers in the exact same order you received it in the input. In other words, store everything in a vector / array until 42, and then with a for loop just print every element from the array / list / vector

leszekrz_53: 2022-04-12 23:15:07

Really poor definition of this task cousing a lot of confusion.
What is input? Stdin, console, file?
Same regarding output.
Shown example: is it 5 lines input or what?

jmathes: 2022-03-18 22:55:59

It needs to be clearer how to accept the input. If it's stdin, you need to say so

owais112: 2022-03-16 14:15:51

prompt method of javascript is not working here why

sravan_2001: 2022-03-09 05:23:35

Good

ravi_2112: 2022-01-19 20:09:35



the code is correct on other complier why not this

Last edit: 2022-01-19 20:10:37

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