实验八第二题写完
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//test.java
|
||||
package step2;
|
||||
|
||||
import java.io.File;
|
||||
@@ -10,7 +11,7 @@ public class AddTimeTable {
|
||||
|
||||
public static void start(String time1, String time2) throws IOException {
|
||||
/********** Begin *********/
|
||||
File file = new File("src/step2/AddTimeTable.java");
|
||||
File file = new File("src/step2/Time_Table.txt");
|
||||
FileWriter writer = new FileWriter(file);
|
||||
writer.write(time1);
|
||||
writer.write(LINE_SEPARATOR);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//test.java
|
||||
package step2;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class test {
|
||||
public static void main(String[] args) throws IOException {
|
||||
AddTimeTable addTimeTable = new AddTimeTable();
|
||||
String time1 = "T246 | 郑州 | 青岛 | 15:00 | 23:00 | 8小时";
|
||||
String time2 = "K765 | 西宁 | 拉萨 | 16:00 | 14:00+1 | 22小时";
|
||||
addTimeTable.start(time1, time2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user