Source code for submission s797

Bugs.java

  1.  
  2. import java.io.BufferedReader;
  3.  
  4. /*
  5.  * To change this template, choose Tools | Templates
  6.  * and open the template in the editor.
  7.  */
  8. import java.io.IOException;
  9. import java.io.InputStreamReader;
  10. import java.util.StringTokenizer;
  11.  
  12. /**
  13.  *
  14.  * @author cteam051
  15.  */
  16. public class Bugs {
  17.  
  18. /**
  19.   * @param args the command line arguments
  20.   */
  21. public static void main(String[] args) {
  22. int N;
  23. String Bug, line="";
  24. while (true){
  25. try {
  26. st = new StringTokenizer(input.readLine());
  27. } catch (IOException ex) {
  28. return;
  29. }
  30. N=Integer.parseInt(st.nextToken());
  31. Bug = st.nextToken();
  32. for (int idx = 0; idx < N; idx++) {
  33. try {
  34. line = input.readLine();
  35. } catch (IOException ex) {
  36. }
  37. while (line.contains(Bug)){
  38. line=line.replaceAll(Bug, "");
  39. }
  40. System.out.println(line);
  41. }
  42.  
  43. }
  44.  
  45.  
  46. }
  47.  
  48. }
  49.  
  50. //7 BUG
  51. //print "No bugsjsdfhgskhgsl"
  52. //
  53. //sdilfhgekhgkesd
  54. //BUGBUG
  55. // printfBUG()slidhfgsl
  56. //}
  57. //
  58. //1 ERR
  59. //wriERRERRtelERRn("Hello E-R-R");
  60. //1 ERR
  61. //EERRRRbla
  62.