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.
Input: 1 2 88 42 99 Output: 1 2 88
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.
Last edit: 2016-08-24 13:52:43
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.
why this program statement shows that program allows taking input from user even after 42 no is taken as input
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?
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.
I sorted the data
My code is running on Ideone, but here shows wrong answer :/
what does stop processing means does testing is to be terminated after occurence of number42
this descripton is not clear
It's just to end the program after inputting 42 without output it -_-Last edit: 2016-07-31 16:43:28
|Added by:||Michał Małafiejski|
|Cluster:||Cube (Intel G860)|
|Resource:||Douglas Adams, The Hitchhiker's Guide to the Galaxy|