Source code for submission s1406

Bugs.java

  1.  
  2. import java.util.Scanner;
  3.  
  4. /*
  5.  * To change this template, choose Tools | Templates
  6.  * and open the template in the editor.
  7.  */
  8.  
  9. /**
  10.  *
  11.  * @author cteam020
  12.  */
  13. public class Bugs {
  14.  
  15. /**
  16.   * @param args the command line arguments
  17.   */
  18. public static void main(String[] args) {
  19. Scanner scan = new Scanner(System.in);
  20.  
  21. while (scan.hasNext()){
  22. int i=scan.nextInt();
  23. String word=scan.next();
  24. for(int x=1;x<=i;x++){
  25. String nuda=scan.nextLine();
  26. String lane=scan.nextLine();
  27. String[] nuda1=new String[20];
  28. while(lane.indexOf(word)!=-1){
  29. nuda1=lane.split(word);
  30. for(int h=0;h<20;h++){
  31. nuda.concat(nuda1[h]);
  32. }
  33. }
  34. System.out.println(nuda);
  35. }
  36.  
  37. }
  38. }
  39.  
  40. }
  41.