zoukankan      html  css  js  c++  java
  • 第七周作业

    package ww;
    
    public class Rectangle {
        int length;
        int width;
    
        public void area() {
            System.out.println(length * width);
        }
    
        public void per() {
            System.out.println((length + width) * 2);
        }
    
        public void all() {
            System.out.println("长是" + length);
            System.out.println("宽是" + length);
            System.out.println("面积是");
            area();
            System.out.println("周长是");
            per();
        }
    }
    package ww;
    
    import java.util.Scanner;
    
    public class text {
    
        public static void main(String[] args) {
            Rectangle r1 = new Rectangle();
            Scanner input = new Scanner(System.in);
            System.out.print("请输入长:");
            r1.length = input.nextInt();
            System.out.print("请输入宽:");
            r1.width = input.nextInt();
            r1.all();
        }
    
    }

  • 相关阅读:
    RSA加密系统
    安装homebrew
    go helloworld
    下载文件checksum
    6月3日
    6月1日
    5月30日
    5月28日
    5月26日
    5月24日
  • 原文地址:https://www.cnblogs.com/hzpiou/p/12721974.html
Copyright © 2011-2022 走看看