实验八第二题Time_Table.txt存档

This commit is contained in:
2024-06-16 15:55:04 +08:00
parent c4ab4bd3a8
commit e15cac83f3
4 changed files with 31 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
这里是第二题
+22
View File
@@ -0,0 +1,22 @@
package step2;
import java.io.File;
import java.io.FileWriter;
import java.io.FileReader;
import java.io.IOException;
public class AddTimeTable {
private static final String LINE_SEPARATOR = System.getProperty("line.separator"); // 定义LINE_SEPARATOR常量,表示换行符
public static void start(String time1, String time2) throws IOException {
/********** Begin *********/
File file = new File("src/step2/AddTimeTable.java");
FileWriter writer = new FileWriter(file);
writer.write(time1);
writer.write(LINE_SEPARATOR);
writer.write(time2);
writer.write(LINE_SEPARATOR);
writer.close();
/********** End *********/
}
}
+7
View File
@@ -0,0 +1,7 @@
车次 | 始发站 | 终点站 | 发车时间 | 到达时间 | 历时
-----|---------|---------|----------|----------|-----
G123 | 北京 | 上海 | 07:00 | 12:30 | 5小时30分
D456 | 广州 | 成都 | 08:30 | 18:00 | 9小时30分
T789 | 深圳 | 西安 | 09:00 | 22:00 | 13小时
K654 | 杭州 | 昆明 | 10:00 | 07:00+1 | 21小时
Z321 | 南京 | 哈尔滨 | 11:00 | 09:00+1 | 22小时
+1
View File
@@ -0,0 +1 @@
这里是第二题