The SPOJ judge submits a file to standard input, which your program reads and generates standard output. The judge then reads the output from your program and verifies it against it's solution.
The sample input is just that, a sample. The real input will likely be quite a bit more involving. If you look at the language specific section of the forum you will see sample code for the problem TEST, which is the one you are solving.
Also read the tutorials on the main page. They are useful.