jave第一周作业
1.输出学号班级和姓名
public class test1 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("计算机1905叶鑫宇"); System.out.println("193230534"); } }
2..输出以下图形
*
***
*****
***
*
package class1; 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 class1; public class test3 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int a=5; int b=8; System.out.println(a+b); System.out.println(a*a+b*b); } }