摘要: public class test8 { public static void main(String[] args) { test81 my = new test81(); my.add(0,10); my.add(1,20); my.add(2,30); my.add(3,40); my.add 阅读全文
posted @ 2020-05-20 20:51 听说在北郭 阅读(329) 评论(0) 推荐(0)
摘要: 1 class Person { 2 public int age = 19; //成员属性 3 public String name = "张三"; 4 /* public String sex; 5 public void eat() { // 成员方法 6 System.out.println 阅读全文
posted @ 2020-05-09 14:56 听说在北郭 阅读(125) 评论(0) 推荐(0)
摘要: 1 import java.util.Arrays; 2 3 public class test7 { 4 /** 5 * 整型数组:偶数放前面,奇数在后 6 * @param arr 7 */ 8 public static void func(int[] arr) { 9 int left = 阅读全文
posted @ 2020-05-04 17:26 听说在北郭 阅读(224) 评论(0) 推荐(0)
摘要: 1 import java.util.Arrays; 2 3 public class test7 { 4 /** 5 * 6 * @param arr 7 */ 8 public static void bubbleSort(int[] arr) { 9 for (int i = 0; i < a 阅读全文
posted @ 2020-05-04 16:56 听说在北郭 阅读(88) 评论(0) 推荐(0)
摘要: 1 import java.util.Arrays; 2 import java.util.Scanner; 3 4 public class test7 { 5 /** 6 * 二分查找:有序数列(升序) 7 * @param arr 8 * @return 9 */ 10 public stat 阅读全文
posted @ 2020-05-04 15:49 听说在北郭 阅读(80) 评论(0) 推荐(0)
摘要: 数组的定义及打印 1 import java.util.Arrays; 2 3 public class test7 { 4 5 /** 6 * 7 * @param args 8 */ 9 public static void main(String[] args) { 10 int[] arra 阅读全文
posted @ 2020-04-30 20:39 听说在北郭 阅读(610) 评论(0) 推荐(0)
摘要: 只有一个盘子的时候,从pos1直接挪到pos3 1 public static void move(char pos1,char pos3) { 2 System.out.println(pos1+"->"+pos3+" "); 3 } 当有n个盘子的时候 n = 1: A->C 一次 n = 2: 阅读全文
posted @ 2020-04-29 16:09 听说在北郭 阅读(202) 评论(0) 推荐(0)
摘要: 1 import java.util.Scanner; 2 public class test72 { 3 /** 4 * 5 * @param args 6 */ 7 public static void num(int n) { 8 if(n > 9) { 9 num(n/10); 10 } 1 阅读全文
posted @ 2020-04-28 11:17 听说在北郭 阅读(852) 评论(0) 推荐(0)
摘要: 1 import java.util.Scanner; 2 3 public class test72 { 4 /** 5 * 求两个数里的最大数 6 * @param args 7 */ 8 public static void main(String[] args) { 9 Scanner sc 阅读全文
posted @ 2020-04-27 19:35 听说在北郭 阅读(1457) 评论(0) 推荐(0)
摘要: 1 public class test72 { 2 /** 3 * 求阶乘和 4 * @param args 5 */ 6 public static void main(String[] args) { 7 int sum = fac2(4); 8 System.out.println(sum); 阅读全文
posted @ 2020-04-26 20:58 听说在北郭 阅读(205) 评论(0) 推荐(0)