Archive
Kattis Challenge "A Different Problem"
“Write a program that computes the difference between non-negative integers.”

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));
}
}
}
}
Related Reading
Related entries
Selected from shared tags, categories, and nearby entries in the same section.

