Skip to content

Commit f1a1a54

Browse files
authored
Create Testing.java
1 parent f37b2ba commit f1a1a54

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Easy-Level/Testing.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import java.io.*;
2+
public class Main {
3+
public static void main (String[] args) throws IOException {
4+
File file = new File(args[0]);
5+
BufferedReader br = new BufferedReader(new FileReader(file));
6+
String line;
7+
while ((line = br.readLine()) != null) {
8+
String[] a = line.replace(" | ", " ").split(" ");
9+
int num = 0;
10+
for (int i = 0; i < a[0].length(); i++) {
11+
if (a[0].charAt(i)!=a[1].charAt(i)) {
12+
num++;
13+
}
14+
}
15+
if (num>6) System.out.println("Critical");
16+
else if (num==5||num==6) System.out.println("High");
17+
else if (num==3||num==4) System.out.println("Medium");
18+
else if (num==1||num==2) System.out.println("Low");
19+
else System.out.println("Done");
20+
}
21+
br.close();
22+
}
23+
}

0 commit comments

Comments
 (0)