-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
43 lines (34 loc) · 814 Bytes
/
Copy pathMain.java
File metadata and controls
43 lines (34 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import java.io.FileNotFoundException;
public class Main {
/**
* @param args
*/
private static String inFileName = "input.txt";
private static String outFileName = "result.txt";
public static void main(String[] args) {
try{
if(args.length == 0)
;
else if(args.length == 1)
inFileName = args[0];
else if(args.length == 2) {
inFileName = args[0];
outFileName = args[1];
}
else throw new ConflictException("Invalid Arguments");
Solver solver = new Solver(inFileName, outFileName);
solver.run();
}
catch(ConflictException ex) {
ex.printMsg();
System.out.println("Cannot solve it");
}
catch(FileNotFoundException ex) {
System.out.println("FileNotFound");
System.out.println("Cannot solve it");
}
finally{
System.exit(0);
}
}
}