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.
My code is working fine on Eclipse. However, it shows a compilation error here. Can someone tell me what's going on?
hi, do i need to read the input values from compiler or static array.
i want the solution
Okay how many test cases does it need to have? I mean how many does the program accepts? Is it user defined or fixed at 5 as the example?
In reply to some comments i would like to say that there is no specific difference between the use of endl and"\n" because I was able to execute the code using both and the submission was correct !!
How does the user tell the programs that it is done entering all the numbers and is now ready for the output?
Man! Spent so much time figuring out what I did wrong! The program requires "\n" when printing the output. I was using endl !
I've written a code which runs fine on my PC. Doesn't seem to work here. I am "hard-coding" the array. How to pass on the array?
my code Is running on ideone it but shows wrong answer on submission..
how input is supposed to be taken?
|Added by:||Michał Małafiejski|
|Cluster:||Cube (Intel G860)|
|Resource:||Douglas Adams, The Hitchhiker's Guide to the Galaxy|