Java第一次作业
1 public class Zuoye1 2 { 3 public static void main(String [] args) { 4 for(int a = 1;a<=3;a++){ 5 for(int b = 1;b<=(3-a);b++){ 6 System.out.print(" "); 7 } 8 for(int c = 1;c<=2*a-1;c++){ 9 System.out.print("*"); 10 } 11 System.out.print("\n"); 12 } 13 for(int a =2;a>=1;a--) { 14 for(int b = 2;b>=a;b--){ 15 System.out.print(" "); 16 } 17 for(int c = 1;c<=2*a-1;c++){ 18 System.out.print("*"); 19 } 20 System.out.print("\n"); 21 } 22 } 23 }
1 public class Zuoye1
2 {
3 public static void main(String [] args)
4 {
5
6 System.out.println("计算机1902 14 刘德广");
7 }
8 }
1 public class Zuoye1 2 { 3 public static void main(String[] args) { 4 int a = 5; 5 int b = 8; 6 System.out.println(a*a + b*b); 7 } 8 }