2022年7月17日

数组

摘要: public class demo01 { public static void main(String[] args) { int sum=0; int [] arrays= {1,2,3,4,5,6}; for (int i = 0; i < arrays.length; i++) { Syst 阅读全文

posted @ 2022-07-17 03:02 大风吹过12138 阅读(19) 评论(0) 推荐(0)

递归

摘要: 算阶乘 基数过大容易导致电脑负荷过重 阅读全文

posted @ 2022-07-17 02:57 大风吹过12138 阅读(6) 评论(0) 推荐(0)

可变参数

摘要: 阅读全文

posted @ 2022-07-17 02:08 大风吹过12138 阅读(21) 评论(0) 推荐(0)

方法重载

摘要: 方法名相同,参数类型,数量,排列顺序不同 //比大小 public class demo01 { public static void main(String[] args) { int num=(int)add(0.5,0.4); System.out.println(num); } public 阅读全文

posted @ 2022-07-17 02:01 大风吹过12138 阅读(27) 评论(0) 推荐(0)

2022年7月16日

方法

摘要: 阅读全文

posted @ 2022-07-16 17:06 大风吹过12138 阅读(9) 评论(0) 推荐(0)

打印三角形

摘要: //打印三角形 public class test01 { public static void main(String[] args) { for (int i = 0; i < 6; i++) { for (int j = 6; j >= i; j--) { System.out.print(" 阅读全文

posted @ 2022-07-16 00:54 大风吹过12138 阅读(25) 评论(0) 推荐(0)

2022年7月15日

for循环

摘要: //打印九九乘法表 public class demo06 { public static void main(String[] args) { for (int j = 1; j <=9; j++) { for (int i = 1; i <= j; i++) { System.out.print 阅读全文

posted @ 2022-07-15 18:04 大风吹过12138 阅读(29) 评论(0) 推荐(0)

while循环和dowhile循环

摘要: public class demo03 { public static void main(String[] args) { int i = 1; int sum=0; do{ sum=i+sum; i++; } while (i<=100); System.out.println(sum); } 阅读全文

posted @ 2022-07-15 17:32 大风吹过12138 阅读(29) 评论(0) 推荐(0)

2022年7月14日

swich

摘要: public class demo02 { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); char a= '2'; switch (a){ case '1': System.out.p 阅读全文

posted @ 2022-07-14 16:07 大风吹过12138 阅读(145) 评论(0) 推荐(0)

IF选择结构

摘要: public class grade { public static void main(String[] args) { System.out.println("请输入成绩:");; Scanner scanner=new Scanner(System.in); int g=0; g=scanne 阅读全文

posted @ 2022-07-14 15:19 大风吹过12138 阅读(22) 评论(0) 推荐(0)

导航