Initial commit

This commit is contained in:
2025-11-06 10:29:13 +08:00
commit 0becd14830
318 changed files with 7145 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
flowchart TD
A[开始] --> B[初始化 sum=0]
B --> C[创建 FileReader 读取 in.txt]
C --> D[创建 StringBuilder number]
D --> E{"reader.read() 返回 ch"}
E -- != -1 --> F{"Character.isDigit(ch)?"}
F -- 是 --> G["number.append(ch 转字符)"]
F -- 否 --> H{ch 是 ',' 或 '\n'?}
H -- 是 --> I{number 是否为空?}
I -- 否 --> J["sum += Integer.parseInt(number)"]
J --> K["number.setLength(0)"]
K --> E
H -- 否 --> E
E -- == -1 --> L{"number.length()>0?"}
L -- 是 --> M["sum += Integer.parseInt(number)"]
L -- 否 --> N[跳过]
M --> N
N --> O[关闭 FileReader]
O --> P[创建 FileWriter 写入 sum.txt]
P --> Q[将 sum 转为字符串写入]
Q --> R[关闭 FileWriter]
R --> S[程序结束]