Source code for submission s889

Go to diff to previous submission

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.io.BufferedReader;
  9. import java.io.Reader;
  10. import java.io.StringReader;
  11. import java.util.ArrayList;
  12. import java.util.LinkedList;
  13. import java.util.List;
  14. import java.util.Scanner;
  15.  
  16. /**
  17.  *
  18.  * @author student
  19.  */
  20. public class Bugs {
  21.  
  22. /**
  23.   * @param args the command line arguments
  24.   */
  25. public static void main(String[] args) {
  26.  
  27. Scanner scanner = new Scanner(System.in);
  28. String row = scanner.nextLine();
  29.  
  30. ArrayList<String> rows = new ArrayList<String>();
  31.  
  32. while(!row.equals("")) {
  33. String[] split = row.split(" ");
  34. int rowCount = Integer.parseInt(split[0]);
  35. String text = split[1];
  36.  
  37. for (int i = 0; i < rowCount; i++) {
  38. String row2 = scanner.nextLine();
  39. String tmp = row2.replace(text, "");
  40. //System.out.println(row2);
  41. rows.add(tmp);
  42. }
  43. row = scanner.nextLine();
  44. }
  45.  
  46. for (String r : rows) {
  47. System.out.println(r);
  48. }
  49.  
  50. }
  51. }
  52.  

Diff to submission s824

Bugs.java

--- c4.s824.cteam124.bugs.java.0.Bugs.java
+++ c4.s889.cteam124.bugs.java.0.Bugs.java
@@ -6,4 +6,7 @@
 
 
+import java.io.BufferedReader;
+import java.io.Reader;
+import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.LinkedList;
@@ -24,4 +27,5 @@
         Scanner scanner = new Scanner(System.in);
         String row = scanner.nextLine();
+    
         ArrayList<String> rows = new ArrayList<String>();