Source code for submission s1282

Go to diff to previous submission

Bugs.java

  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4.  
  5.  
  6. public class Bugs {
  7. private static BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
  8.  
  9. public static void main(String[] args) {
  10. while (true) {
  11. try {
  12. String linka;
  13. linka = bfr.readLine();
  14. if (linka == null) break;
  15.  
  16. String[] ln = linka.split(" ");
  17. if (ln.length < 2) break;
  18.  
  19. int pocet = Integer.parseInt(ln[0]);
  20. String hledany = ln[1];
  21. for(int i=0; i<pocet; i++) {
  22. linka = bfr.readLine();
  23. while (true) {
  24. int delka = linka.length();
  25. linka = linka.replace(hledany, "");
  26. if (delka == linka.length()) break;
  27. }
  28. System.out.println(linka);
  29. }
  30.  
  31. } catch (IOException e) {
  32. break;
  33. }
  34. }
  35. }
  36. }
  37.  

Diff to submission s566

Bugs.java