-------------------------------------------------------------------------------------------
Ideas See the Jin SAC 2
-------------------------------------------------------------------------------------------
Algorithm
1 ImportJava.util.Scanner;2 Public classMain {3 Public Static voidMain (string[] args) {4Scanner sc =NewScanner (system.in);5 Double[] x =New Double[4];6 Double[] y =New Double[4];7 Double[] Z =New Double[4];8 for(inti=0;i<4;i++){9X[i] =sc.nextdouble ();TenY[i] =sc.nextdouble (); One } AZ[0] = Math.max (Math.min (x[0], x[1]), Math.min (X[2], x[3]));//X1 -Z[1] = Math.min (Math.max (x[0], x[1]), Math.max (X[2], x[3]));//X2 - theZ[2] = Math.max (Math.min (y[0], y[1]), Math.min (Y[2], y[3]));//Y1 -Z[3] = Math.min (Math.max (y[0], y[1]), Math.max (Y[2], y[3]));//y2 - if(z[0]<z[1]&&z[2]<z[3]) -System.out.printf ("%.2f\n", (Z[1]-z[0]) * (z[3]-z[2])); + Else -System.out.println ("0.00"); + } A}
Blue Bridge Net question Java basic Practice Rectangle area Intersection