1.输出学号班级和姓名
public class work1 {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("193230526 计算机1905 吴嘉豪");

}

}

2.输出以下图形

     *
    ***
   *****
    ***
     *
public class work2 {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(" *");
System.out.println(" ***");
System.out.println("*****");
System.out.println(" ***");
System.out.println(" *");

}

}

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

public class work3 {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int a=5,b=8,c;
c=a*a+b*b;
System.out.println(c);

}

}

 posted on 2021-03-07 18:03  莉莉娅king  阅读(10)  评论(0编辑  收藏  举报