随笔分类 - Day_03
摘要:打印正三角形 public class TestDemo01 { public static void main(String[] args) { //打印三角形 5行 for (int i = 1; i < 5; i++) { for (int j = 5; j >= i;j--) { Syste
阅读全文
摘要:For的基础结构 public class ForDeom01 { public static void main(String[] args) { //求0-100之间奇数和偶数的和 int sumOdd = 0; int sumEven = 0; for(int i = 0;i <= 100;i
阅读全文
摘要:While 的基础结构 public class WhileDemo01 { public static void main(String[] args) { //输出1-100 int i = 0; while (i < 100){ i++; System.out.println(i); } }
阅读全文
摘要:Switch的基础结构 public class SwitchDeom01 { public static void main(String[] args) { char s = 'C'; switch (s){ case 'A': System.out.println("优秀"); break;
阅读全文
摘要:if的三种基础结构 import java.util.Scanner; //if单选择 public class IfDoem { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); S
阅读全文
浙公网安备 33010602011771号