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
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.
@hrishikesshhhh - take first input outside while, then take next inputs inside while
jakie to są duże liczby czyli te, które trzeba pominąć? albo jakie to są małe liczby czyli te, które należy wypisać?
I tried doing this using a while loop. Only problem is that it prints 42 as well. it should not print $2 and I am unable to think how to print everything other than 42.
what is the kind of input, a array a list or what?
it's better not to use an array and simply output when receiving an input not equal to 42
@un_9own great idea! we all know how useful it is to allocate array sizes based on randomness. imagine the fun we will have trying to figure out why the solution passes one run but not the next!
|Cluster:||Cube (Intel G860)|
|Resource:||Douglas Adams, The Hitchhiker's Guide to the Galaxy|