package xiaochengxu;import java.util.Scanner;public class mianjizhengfangxing extends mianji1 { Scanner zhengfangxing=new Scanner(System.in); System.out.print("请输入正方形的长:"); int chang=zhengfangxing.nextInt(); System.out.print("请输入正方形的宽:"); int kuan=zhengfangxing.nextInt(); @Override public void mianji() { // TODO Auto-generated method stub int mianji=chang*kuan; System.out.println("正方形的面积为"+mianji); } @Override public void zhouchang() { // TODO Auto-generated method stub int zhouchang=(chang+kuan)*2; System.out.println("正方形的面积为"+zhouchang); }}
添加回答
举报
0/150
提交
取消