标签:style blog ar color os sp java on 数据
描述求A+B是否与C相等。
3
-11.1 +11.1 0
11 -11.25 -0.25
1 2 +4
Yes
Yes
No
1 import java.util.Scanner; 2 3 public class Main { 4 public static void main(String[] args) { 5 Scanner scanner=new Scanner(System.in); 6 int T; 7 double a; 8 double b; 9 double c; 10 11 T=scanner.nextInt(); 12 while(true){ 13 if(T==0) 14 break; 15 T--; 16 17 a=scanner.nextDouble(); 18 b=scanner.nextDouble(); 19 c=scanner.nextDouble(); 20 21 if(Math.abs(a+b-c)<=1e-4) 22 System.out.println("Yes"); 23 else 24 System.out.println("No"); 25 } 26 } 27 }
标签:style blog ar color os sp java on 数据
原文地址:http://www.cnblogs.com/zqxLonely/p/4133175.html