摘要: ``` #include #include #define MAXSIZE 10 #define NotFound 0 typedef int ElementType; typedef int Position; typedef struct LNode *List; struct LNode { ElementType Data[MAXSIZE]; Position Last; /* 保存线性表 阅读全文
posted @ 2020-05-18 16:54 半羽 阅读(135) 评论(0) 推荐(0)
摘要: 分析已达百到文件结尾一般是因为括号没有闭合,或者缺少了分号 阅读全文
posted @ 2020-05-18 11:51 半羽 阅读(5139) 评论(0) 推荐(0)
摘要: `import java.util.ArrayList;` 三种遍历方法: 阅读全文
posted @ 2020-05-18 11:50 半羽 阅读(336) 评论(0) 推荐(0)
摘要: 将由数字组成的字符串转化为数组: `arr[i] = Integer.valueOf(first[i]);` 在定义数字或者数组的时候用Integer可以在后续方便使用各种方法 阅读全文
posted @ 2020-05-18 11:14 半羽 阅读(274) 评论(0) 推荐(0)
摘要: 刚开始,用的 ,报错java.lang.NullPointerException空指针异常。 当一个对象的值为空时,并且没有判断为空的情况。可以试着把下面的代码前加一行代码: `if(rb!=null);` 阅读全文
posted @ 2020-05-18 10:31 半羽 阅读(135) 评论(0) 推荐(0)
摘要: or `return ""+num;` 阅读全文
posted @ 2020-05-18 09:30 半羽 阅读(610) 评论(0) 推荐(0)
摘要: ``` String greeting = "Hello"; String u = greeting.replaceAll("(?i)[aeiou]", ""); System.out.println(u); // Hll ``` 阅读全文
posted @ 2020-05-13 11:49 半羽 阅读(276) 评论(0) 推荐(0)
摘要: ``` package exception; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); Fraction a = new Fraction(in.nextInt(), in.nextInt()) 阅读全文
posted @ 2020-05-11 22:10 半羽 阅读(67) 评论(0) 推荐(0)
摘要: ``` package exception; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); Fraction a = new Fraction(in.nextInt(), in.nextInt()) 阅读全文
posted @ 2020-05-11 22:08 半羽 阅读(117) 评论(0) 推荐(0)
摘要: ``` double toDouble() { return (double) num1 / num2; } ``` ``` double toDouble() { return num1 * 1.0 / num2; } ``` 阅读全文
posted @ 2020-05-11 22:07 半羽 阅读(526) 评论(0) 推荐(0)