Source code for submission s725

Go to diff to previous submission

Bugs.java

  1. import java.io.BufferedReader;
  2.  
  3. /*
  4.  * To change this template, choose Tools | Templates
  5.  * and open the template in the editor.
  6.  */
  7. import java.io.IOException;
  8. import java.io.InputStreamReader;
  9.  
  10. class Bugs {
  11.  
  12. /**
  13.   * @param args the command line arguments
  14.   */
  15. public static void main(String[] args) throws IOException {
  16. while(true){
  17. String firstLine = br.readLine();
  18. if(firstLine == null) return;
  19. String [] firstWords = firstLine.split(" ");
  20. int lineCount = Integer.parseInt(firstWords[0]);
  21.  
  22. String errorCode = firstLine.substring(firstWords[0].length() + 1);
  23. // System.out.println(errorCode + " " + errorCode.length());
  24. int errorCodeLength = errorCode.length();
  25. String line = "";
  26.  
  27. for (int i = 0; i < lineCount; i++) {
  28. line = br.readLine();
  29. if(line.length() >= errorCodeLength){
  30. while(line.contains(errorCode)){
  31.  
  32. line = line.replaceAll(errorCode, "");
  33. }
  34. }
  35. System.out.println(line);
  36. }
  37. }
  38.  
  39. }
  40.  
  41. }
  42.  

Diff to submission s629

Bugs.java

--- c4.s629.cteam037.bugs.java.0.Bugs.java
+++ c4.s725.cteam037.bugs.java.0.Bugs.java
@@ -14,5 +14,5 @@
      */
     public static void main(String[] args) throws IOException {
-        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
+        BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 2000000);
                         while(true){
         String firstLine = br.readLine();