Source code for submission s609

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.  
  25. for (int i = 0; i < lineCount; i++) {
  26. String line = br.readLine();
  27. while(line.contains(errorCode)){
  28.  
  29. line = line.replaceAll(errorCode, "");
  30. }
  31. System.out.println(line);
  32. }
  33. }
  34.  
  35. }
  36.  
  37. }
  38.