面向对象程序设计第一次作业

1.输出学号班级和姓名

public class testhello {

    /**
     * @param args
     */
    public static void main(String[] args) {
        System.out.println("193230515,计算机1905,明皓文");
        

    }

}

 

2.输出以下图形

     *
    ***
   *****
    ***
     *

public class testhello {

    /**
     * @param args
     */
    public static void main(String[] args) {
        System.out.println("  *  ");
        System.out.println(" *** ");
        System.out.println("***** ");
        System.out.println(" *** ");
        System.out.println("  *  ");
        

    }

}

 

3.定义两个整型变量a=5  b=8  求平方和并输出

public class testhello {

    /**
     * @param args
     */
    public static void main(String[] args) {
        int a=5;
        int b=8;
        System.out.println(a*a+b*b);

        

    }

}

posted on 2021-03-08 09:02  我裂开  阅读(34)  评论(0编辑  收藏  举报

导航