摘要:
流程控制练习: 1 package struct; 2 3 public class TestDemo { 4 public static void main(String[] args) { 5 //打印三角形 5行 6 for (int i = 0; i <= 5 ; i++) { 7 for 阅读全文
摘要:
1 package struct; 2 3 public class BreakDemo { 4 public static void main(String[] args) { 5 int i = 0 ; 6 while(i<100){ 7 i++; 8 System.out.println(i) 阅读全文
摘要:
1 package struct; 2 3 public class ForDemo05 { 4 public static void main(String[] args) { 5 int[] numbers = {10,20,30,40,50};//定义一个数组 6 for (int i = 0 阅读全文
摘要:
① 1 package struct; 2 3 public class ForDemo04 { 4 public static void main(String[] args) { 5 /* 6 1 * 1 = 1 7 1 * 2 = 2 2 * 2 = 4 8 1 * 3 = 3 2 * 3 = 阅读全文
摘要:
1 package struct; 2 3 public class ForDemo01 { 4 public static void main(String[] args) { 5 int a = 1;//初始化条件 6 while(a<=100){//条件判断 7 System.out.prin 阅读全文
摘要:
1 package struct; 2 3 public class DoWhileDemo01 { 4 public static void main(String[] args) { 5 int i = 0; 6 int sum = 0; 7 do { 8 sum = sum + i; 9 i+ 阅读全文
摘要:
1 package struct; 2 3 public class WhileDemo01 { 4 public static void main(String[] args) { 5 int i = 0; 6 while(i<100){ 7 i++; 8 System.out.println(i 阅读全文