Friday, 10 February 2012

Root :: AOAPC I: Beginning Algorithm Contests (Rujia Liu) :: Volume 0. Getting Started :: 10055 - Hashmat the Brave Warrior




Solution :




import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Scanner;

class Main {

    public static void main(String[] args) throws IOException {
        new Main().begin();
    }

    private void begin() {
        Scanner in = new Scanner(System.in);
        PrintStream ps = new PrintStream(System.out);
        while (in.hasNext()) {
            long x = in.nextLong();
            long y = in.nextLong();
            System.out.println(Math.abs(y - x));
        }
    }
}

No comments:

Post a Comment