Source code for submission s561

bugs.java

  1. import java.io.BufferedReader;
  2. import java.io.InputStreamReader;
  3.  
  4.  
  5. public class bugs {
  6.  
  7. /**
  8. * @param args
  9. */
  10. public static void main(String[] args) throws Exception {
  11.  
  12. String s, bug;
  13. int n, pos, len;
  14.  
  15. while (true)
  16. {
  17. s = br.readLine();
  18. if (s == null) break;
  19.  
  20. pos = s.indexOf(" ");
  21. n = Integer.parseInt(s.substring(0, pos));
  22. bug = s.substring(pos + 1);
  23.  
  24. for (int i = 0; i < n; i++)
  25. {
  26. s = br.readLine();
  27. do
  28. {
  29. len = s.length();
  30. s = s.replace(bug, "");
  31. }
  32. while (len != s.length());
  33. System.out.println(s);
  34. }
  35. }
  36. }
  37.  
  38. }
  39.