Last active
February 9, 2017 12:40
-
-
Save cbilson/d3f97adc0e20acd3922baa6d811c6d9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.Scanner; | |
public class Absolutely { | |
public static void main(String[] args) throws FileNotFoundException { | |
//Scanner scanner = new Scanner(System.in); | |
Scanner scanner = new Scanner(new File("C:\\Users\\cbilson\\Absolutely.txt")); | |
int problems = scanner.nextInt(); | |
for (int i = 0; i < problems; i++) { | |
double x = scanner.nextDouble(); | |
double y = scanner.nextDouble(); | |
double d = Math.abs(x - y); | |
System.out.println(Math.round(d * 10.0) / 10.0); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment