随笔分类 - 基础
摘要:for (int i = 0; i < row; i++) { Arrays.fill(isVisited[i], false); }
阅读全文
摘要:拿到矩形的外圈 for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { if (i == 0 || i == row - 1 || j == 0 || j == col - 1) { if (board[i][j] == 'O'
阅读全文
摘要:BigInteger 我们使用BigInteger类的构造函数将字符串str转换为对应的大整数。BigInteger类可以处理任意位数的整数,无论数字有多大。 常用方法: 1. 构造方法 BigInteger(String val); // 使用字符串创建BigInteger对象。 2. 基本操作方
阅读全文
摘要:ACM二维数组的读取 输入 5 5 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 读取 Scanner in = new Scanner(System.in); int row = in.nextInt(); int col = in.nextI
阅读全文
摘要:# 正则表达式匹配引号 ## 1. 单引号 ```java String regex = "'"; ``` ## 2. 双引号 反斜杠(\)用于转义双引号字符,以确保它被正则表达式引擎正确解析。 ```java String s = new StringBuilder(in.nextLine()).
阅读全文
摘要:# List删除指定区域的元素 ```bash The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-
阅读全文
摘要:# 1. 区分大小写 ```java str1.compareTo(str2) ``` ## 2. 不区分大小写 ```java str1.compareToIgnoreCase(str2) ```
阅读全文
摘要: 举例子 ```java Integer num1 = 10; Integer num2 = 10; System
阅读全文
摘要:```java int weight = (int) Math.ceil(arr[i - 1] / 512.0); // 向上取整 ```
阅读全文
摘要:1. Java 的浮点运算是基于 IEEE-754 标准来的。 IEEE-754 standard Java's Floating-Point Operations 2. Java 语言规范 https://docs.oracle.com/javase/specs/jls/se7/html/jls-
阅读全文
摘要:Java是不能直接在类中对变量进行赋值的 错误案例 只能在定义的时候赋值 或者在方法中赋值,或者在代码块中赋值 public class uuq { public static void main(String[] args) { c c = new c(); c.update(3); System
阅读全文