Go to diff to previous submission
--- c4.s770.cteam071.bugs.java.0.Bugs.java +++ c4.s854.cteam071.bugs.java.0.Bugs.java @@ -5,25 +5,21 @@ public class Bugs { public static void main(String[] args) throws Exception { - int t,i; - String b; + BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); - Scanner sc = new Scanner(System.in); - while (sc.hasNextInt()) { - t = sc.nextInt(); - /*System.out.println(t);*/ - b = sc.nextLine(); - b = b.replace(" ", ""); - /*System.out.println(b);*/ - for (i = 1; i <= t; i++) { - /*System.out.println("bent");*/ - String s = sc.nextLine(); - /*System.out.println(s);*/ - while (s.contains(b)) { - s = s.replace(b, ""); + while (true) { + String f = reader.readLine(); + if (f.equals("")) break; + String v[] = f.split(" "); + + int t = Integer.parseInt(v[0]); + for (int i = 1; i <= t; i++) { + String s = reader.readLine(); + while (s.contains(v[1])) { + s = s.replace(v[1], ""); } System.out.println(s); } - } + }