Sphere Online Judge

SPOJ Problem Set (classical)

1. Life, the Universe, and Everything

Problem code: TEST

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.





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.

Added by:Micha≥ Ma≥afiejski
Time limit:10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel Pentium G860 3GHz)
Resource:Douglas Adams, The Hitchhiker's Guide to the Galaxy

hide comments
2014-08-31 11:31:48 Shrey
What is the terminating condition for taking input ???
2014-08-30 14:54:23 Adesh Atole
How many inputs to take??
2014-08-29 07:32:57 Jerry-Chan
It is so easy!
2014-08-26 18:26:36 Yash Sharma
This is my first problem on SPOJ !!!!!!!!!!!!!!
2014-08-21 15:56:15 sourish
When i tried to compile my program,it showed me run-time error. I am not understanding as why it is showing the abovesaid message.
2014-08-20 15:07:35 RAHUL JAIN
how many numbers we have to take as input??

Last edit: 2014-08-20 15:09:07
2014-08-16 22:02:13 Nilay Engineer
@SACHIN, try #include<iostream> (without the .h part)
and below that line add another code:
'using namespace std;'
2014-08-12 17:41:28 SACHIN
prog.cpp: In function 'int main()':
prog.cpp:7: error: 'cin' was not declared in this scope
prog.cpp:8: error: 'cout' was not declared in this scope
prog.cpp:19: error: 'getch' was not declared in this scope

what header files should i include for it??
I tried iostream.h, conio.h, stdio.h!!!
still getting the same error..
2014-08-09 13:52:50 Manoj Atchut Nalajala

Last edit: 2014-08-09 14:01:27
2014-08-07 13:48:17 Raj Kumar Chauhan
@mesh na @vishnu you can write any file name, and file xtensn acc. to ur prgmng lang.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.