Java第一次作业
1、输出学号班级姓名
package homework; public class Test1 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("193230332计算机1903张慧"); } }
2.输出以下图形
*
***
*****
***
*
package homework; public class Test2 { /** * @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 求平方和并输出
package homework; public class Tesy3 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int a=5; int b=8; System.out.println(a*a+b*b); } }