摘要: package array;import java.util.Arrays;public class demo02 { public static void main(String[] args) { int[] a ={1,31,321,32,23,4,45}; int[] sort = sort 阅读全文
posted @ 2021-08-27 11:03 AAA编程 阅读(38) 评论(0) 推荐(0)
摘要: package array;public class Demo03 { public static void main(String[] args) { int[] arrays = {1,2,3,4,5}; for (int i = 0; i <arrays.length ; i++) { Sys 阅读全文
posted @ 2021-08-27 10:08 AAA编程 阅读(29) 评论(0) 推荐(0)
摘要: package array;public class ArrayDemo01 { public static void main(String[] args) { int[] nums; nums = new int[10]; nums[0] = 1; nums[1] = 2; nums[2] = 阅读全文
posted @ 2021-08-27 09:47 AAA编程 阅读(35) 评论(0) 推荐(0)
摘要: package method;public class Demo02 { public static void main(String[] args) { int max = max(10, 20); System.out.println(max); } //比大小 public static in 阅读全文
posted @ 2021-08-26 16:36 AAA编程 阅读(36) 评论(0) 推荐(0)
摘要: package struct;public class BreakDemo { public static void main(String[] args) { int i =0; while (i<100) { i++; System.out.println(i); if (i == 30) { 阅读全文
posted @ 2021-08-25 17:04 AAA编程 阅读(43) 评论(0) 推荐(0)
摘要: package struct;public class ForDemo05 { public static void main(String[] args) { int[] numbers = {10,20,30,40,50};//定义数组 for (int i = 0; i < 5; i++) { 阅读全文
posted @ 2021-08-25 17:00 AAA编程 阅读(22) 评论(0) 推荐(0)
摘要: package struct;public class ForDemo04 { public static void main(String[] args) { //1.打印第一列 //2.再用一个循环包起来 //3.去掉重复项 //4.调整样式 for (int j = 0; j <= 9; j+ 阅读全文
posted @ 2021-08-25 16:54 AAA编程 阅读(123) 评论(0) 推荐(0)
摘要: package struct;public class ForDemo03 { public static void main(String[] args) { //练习2 用while或for循环输出1-1000之间能被5整除的数,并且每行输出3个 for (int i = 0; i < 1000 阅读全文
posted @ 2021-08-25 16:23 AAA编程 阅读(206) 评论(0) 推荐(0)
摘要: package struct;public class ForDemo02 { public static void main(String[] args) { int oddSum=0; int evenSum=0; for (int i = 0; i < 100; i++) { if(i%2!= 阅读全文
posted @ 2021-08-25 16:16 AAA编程 阅读(38) 评论(0) 推荐(0)
摘要: package struct;public class WhileDemo02 { public static void main(String[] args) { //计算1+2+3...+100=? int i =0; int sum =0; while(i<=100){ sum=sum+i; 阅读全文
posted @ 2021-08-25 15:42 AAA编程 阅读(1050) 评论(0) 推荐(0)