标签:static util data 保留 buffered 小数 void output 一个
import java.io.BufferedWriter; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.*; public class Main { public static void main(String [] args){ Scanner sc =new Scanner(System.in); double a=sc.nextDouble(); double b=sc.nextDouble(); double c=sc.nextDouble(); double d=sc.nextDouble(); double A=sc.nextDouble(); double B=sc.nextDouble(); double C=sc.nextDouble(); double D=sc.nextDouble(); double m = Math.max(Math.min(a,c),Math.min(A,C)); double n = Math.max(Math.min(b,d),Math.min(B,D)); double M = Math.min(Math.max(a,c),Math.max(A,C)); double N =Math.min(Math.max(b,d),Math.max(B,D)); if(M>m&&N>n) System.out.printf("%.2f",(M-m)*(N-n)); else System.out.println("0.00"); } }
标签:static util data 保留 buffered 小数 void output 一个
原文地址:https://www.cnblogs.com/wszhu/p/12607465.html