很菜的方法

import java.util.Scanner;
import java.text.DecimalFormat;
public class Main {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        Rectangle r1=new Rectangle();
        Square s2=new Square();
        Circle c=new Circle();
        r1.juLong=s.nextDouble();
        r1.juWide=s.nextDouble();
        if(r1.juWide!=r1.juLong){
            double q= r1.GetArea(r1.juLong, r1.juWide);
            if (((int)q * 1000) == (int) (q * 1000)){
                System.out.println((int)q);
            }else if(q*10!=(int)q*10){
                System.out.println(String.format("%.2f", q));
            }else
                System.out.println(String.format("%.1f", q));
        }else{
            s2.zr= r1.juLong;
            double w= s2.GetArea(s2.zr);
            System.out.println((int)w);
        }
        c.r=s.nextDouble();
        double e=c.cArea(c.r);
        if (((int) e * 1000) == (int) (e * 1000))
        {
            System.out.println((int)e);
        }else if (e*10!=(int)(e*10)){
            System.out.println(String.format("%.2f", e));
        }else
            System.out.println(String.format("%.1f", e));
        s2.zr=s.nextDouble();
        double t= s2.GetArea(s2.zr);
        if (((int) t * 1000) == (int) (t * 1000)){
            System.out.println((int)t);
        }else if(t*10!=(int)t*10){
            System.out.println(String.format("%.2f",t));
        }else
            System.out.println(String.format("%.1f", t));

    }
}
 class Square extends Rectangle{
    double zr;
    public double GetArea(double zr) {
        double sz=zr*zr;
        return  sz;
    }
}
 class shape {
   public double GetArea(double l,double w){
        double s=l*w;
        return s;
    }
}
 class Circle extends shape{
     double r;
     public double cArea(double r){
          double s=3.14*r*r;
          return  s;
     }
}
 class Rectangle extends shape {
       double juLong;
       double juWide;
}