Skip to content
GG
Ghost Graph
Ghost Graph: Interlinked notes, diagnostics, and proven scripts rendered as a navigable 3D graph.
Reading

Kattis Challenge "A Different Problem"

Return to map

Problem

My solution

import java.util.Scanner;

public class Kattis {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        while (sc.hasNext()) {

            long X = sc.nextLong();
            long Y = sc.nextLong();

            if (X > Y) {
                System.out.println(Math.abs(X - Y));

            } else {
                System.out.println(Math.abs(X - Y));

            }
        }
    }
}