Source code for submission s828

Bugs.java

  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import java.util.Scanner;
  5.  
  6. public class Bugs {
  7.  
  8. public static void main(String[] args) throws IOException {
  9.  
  10.  
  11. while (true) {
  12. String vstupRadka = br.readLine();
  13.  
  14. if (vstupRadka == null) {
  15. break;
  16. }
  17.  
  18. Scanner sc = new Scanner(vstupRadka);
  19.  
  20. int n = sc.nextInt();
  21. String slovo = sc.next();
  22.  
  23. for (int i = 0; i < n; i++) {
  24. String radka = br.readLine();
  25.  
  26. if (!radka.contains(slovo)) {
  27. System.out.println(radka);
  28. } else {
  29. System.out.println(radka.replace(slovo, ""));
  30. }
  31. }
  32. }
  33.  
  34. }
  35.  
  36. }
  37.