Created
April 4, 2018 02:56
-
-
Save godoorsun/76eb0cc254bcc5f81d63fa4617416118 to your computer and use it in GitHub Desktop.
My Code
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
package cn.edu.zjut.java.labacm02; | |
import java.util.Scanner; | |
public class DoublePrecision { | |
public static void main(String[] args) { | |
Scanner cin = new Scanner(System.in); | |
while(cin.hasNext()){ | |
double a = cin.nextDouble(); | |
double b = cin.nextDouble(); | |
int c = cin.nextInt(); | |
for(int i = 0; i < c; i++){ | |
a += cin.nextDouble(); | |
} | |
System.out.println( Math.abs(a -b) < 0.0000000001); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment