Go to diff to previous submission
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package bugs; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Scanner; /** * * @author student */ public class Bugs { /** * @param args the command line arguments */ List<String> result = new ArrayList<String>(); //BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); //String line = br.readLine(); while (line.length() > 0) { Scanner s = new Scanner(line); int rowCount = s.nextInt(); for (int i = 0; i < rowCount; i++) { result.add(tmp); } line = scanner.nextLine(); } } } }
--- c4.s1133.cteam124.bugs.java.0.Bugs.java +++ c4.s1166.cteam124.bugs.java.0.Bugs.java @@ -6,12 +6,8 @@ -import com.sun.rowset.internal.Row; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.Scanner; -import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; /** @@ -30,7 +26,9 @@ - BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); - String line = br.readLine(); + //BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + //String line = br.readLine(); + Scanner scanner = new Scanner(System.in); + String line = scanner.nextLine(); while (line.length() > 0) { @@ -38,18 +36,12 @@ int rowCount = s.nextInt(); String text = s.nextLine().trim(); - + for (int i = 0; i < rowCount; i++) { - String row2 = br.readLine(); + String row2 = scanner.nextLine(); String tmp = row2.replace(text, ""); result.add(tmp); - //System.out.println(tmp); } - -// String row = sc.nextLine(); -// if (row.length() ==0) break; - - - line = br.readLine(); + line = scanner.nextLine(); }