Skip to content

Instantly share code, notes, and snippets.

@godoorsun
Created April 4, 2018 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save godoorsun/76eb0cc254bcc5f81d63fa4617416118 to your computer and use it in GitHub Desktop.
Save godoorsun/76eb0cc254bcc5f81d63fa4617416118 to your computer and use it in GitHub Desktop.
My Code
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