Java第一次作业
1.输出学号班级和姓名
package chap1;public class text1 { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("193230104 计算机1901 冯雨心"); } }
2.输出以下图形
*
***
*****
***
*
package chap1; public class text2 { 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 chap1; public class text3 { public static void main(String[] args) { // TODO Auto-generated method stub int a=5,b=8; int c=a*a+b*b; System.out.println(c); } }