Tuesday, February 12, 2013

Step Ahead in JAVA

Hello everyone, this is my solution for "Life, the Universe, and Everyting" in SPOJ. It was my first submission in JAVA. Take here a look.

/*
Task: Life, the Universe, and Everything (SPOJ)
Code: TEST
*/

import java.io.*;   // java input\output library 
import java.util.*; // using for Scanner class

class LifeSPOJ {
    public static void main ( String [] args ) {
        Scanner ss = new Scanner(System.in);
        int num;
        num = ss.nextInt(); // nest intejar
        while( num != 42 ) {
            System.out.println( num ); // printing that number
            num = ss.nextInt();
        }
    }
}

No comments:

Post a Comment

Thanks - Jajabor, 2014