Source code for submission s899

Go to diff to previous submission

bugs.java

  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import java.io.PrintStream;
  5. import java.util.Scanner;
  6. import java.util.StringTokenizer;
  7.  
  8.  
  9. public class bugs {
  10.  
  11.  
  12. public static void main(String[] args) throws IOException {
  13.  
  14. while(true)
  15. {
  16. String uvod = br.readLine();
  17. if (uvod == null || uvod == "")
  18. return;
  19.  
  20. String[] _a = uvod.split(" ");
  21.  
  22. int line_count = Integer.parseInt(_a[0]);
  23. String repl = _a[1];
  24.  
  25. for (int i = 0; i < line_count; i++){
  26. String str = br.readLine();
  27. int ol = str.length();
  28.  
  29. String ns = str.replace(repl, "");
  30. int l = ns.length();
  31.  
  32. while(l < ol)
  33. {
  34. ns = ns.replace(repl, "");
  35. ol = l;
  36. l = ns.length();
  37. }
  38. o.println(ns);
  39. }
  40.  
  41. }
  42. }
  43.  
  44. }
  45.  

Diff to submission s867

bugs.java

--- c4.s867.cteam114.bugs.java.0.bugs.java
+++ c4.s899.cteam114.bugs.java.0.bugs.java
@@ -34,5 +34,5 @@
                         while(l < ol)
                         {
-                                ns = str.replace(repl, "");     
+                                ns = ns.replace(repl, "");      
                                 ol = l;
                                 l = ns.length();