forked from mfkiwl/DTW_co_processor_front_end
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.java
46 lines (45 loc) · 1.52 KB
/
check.java
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
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class check {
public static void main(String args[]){
File file = new File("vector_output.out");
File file2 = new File("vector_result.out");
BufferedReader reader = null;
BufferedReader reader2 = null;
try {
reader = new BufferedReader(new FileReader(file));
reader2 = new BufferedReader(new FileReader(file2));
String tempString = null;
String tempString2 = null;
int line = 1;
while (line <= 10) {
tempString = reader.readLine();
tempString2 = reader2.readLine();
boolean judge = true;
for(int i = 0; i < tempString2.length(); i++){
if(tempString2.charAt(i) != tempString.charAt(i)){
judge = false;
}
}
if(judge){
System.out.println("The result of " + line + " pass is correct");
}else{
System.out.println("The result of " + line + " pass is wrong");
}
line++;
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e1) {
}
}
}
}
}