-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
51 lines (40 loc) · 1.02 KB
/
Copy pathMain.java
File metadata and controls
51 lines (40 loc) · 1.02 KB
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
44
45
46
47
48
49
50
51
import java.io.FileNotFoundException;
public class Main {
/**
* @param args
*/
private static final String inFileName = "input.txt";
private static final String outFileName = "output.txt";
public static void main(String[] args) {
String in = inFileName;
String out = outFileName;
try{
if(args.length == 0)
;
else if(args.length == 1)
in = args[0];
else if(args.length == 2) {
in = args[0];
out = args[1];
}
else throw new ConflictException("Invalid Arguments");
Solver solver = new Solver(in, out);
solver.run();
}
catch(ConflictException ex) {
ex.printMsg();
System.out.println("Cannot solve it");
//###########################
// this line is important as it will create a output file including sentence "UNSOLVABLE"
HandleFile.CreateErrorFile(out);
//###########################
}
catch(FileNotFoundException ex) {
System.out.println("FileNotFound");
System.out.println("Cannot solve it");
}
finally{
System.exit(0);
}
}
}