1 public class S{ 2 public static void main(String[] args){ 3 double w=4.5; 4 double h=7.9; 5 double d; 6 double s; 7 d=2*(w+h); 8 s=w*h; 9 System.out.println("面积为:" + s); 10 System.out.println("周长为:" + d); 11 } 12 }
1 public class S{ 2 public static void main(String[] args){ 3 double w=4.5; 4 double h=7.9; 5 double d; 6 double s; 7 d=2*(w+h); 8 s=w*h; 9 System.out.println("面积为:" + s); 10 System.out.println("周长为:" + d); 11 } 12 }