Source code for submission s567

Bugs.java

  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package bugs;
  6.  
  7.  
  8. import java.util.LinkedList;
  9. import java.util.List;
  10. import java.util.Scanner;
  11.  
  12. /**
  13.  *
  14.  * @author student
  15.  */
  16. public class Bugs {
  17.  
  18. /**
  19.   * @param args the command line arguments
  20.   */
  21. public static void main(String[] args) {
  22. Scanner s = new Scanner(System.in);
  23. List<String> r = new LinkedList<String>();
  24. String k = s.nextLine();
  25. int g = Integer.parseInt(Character.toString(k.charAt(0)));
  26. String slovo = k.substring(2, k.length());
  27. for (int i = 0; i < g; i++) {
  28. k = s.nextLine();
  29. r.add(k.replace(slovo, ""));
  30. }
  31.  
  32. for (String string : r) {
  33. System.out.println(string);
  34. }
  35.  
  36.  
  37.  
  38. }
  39. }
  40.