Source code for submission s1183

Bugs.java

  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. package acm;
  7.  
  8. import java.util.Scanner;
  9.  
  10. /**
  11.  *
  12.  * @author cteam030
  13.  */
  14. public class Bugs {
  15.  
  16. public static void main(String[] args) {
  17.  
  18. Scanner s = new Scanner(System.in);
  19.  
  20. while(s.hasNext())
  21. {
  22. int lines = s.nextInt();
  23. String bug = s.next();
  24. String line = "";
  25. s.nextLine();
  26.  
  27. for(int i = 0; i < lines; i++)
  28. {
  29. line = s.nextLine();
  30.  
  31. while(line.contains(bug))
  32. {
  33. line = line.replace(bug, "");
  34. }
  35.  
  36. System.out.println(line);
  37. }
  38. }
  39.  
  40. }
  41.  
  42. }
  43.