fork download
  1. import java.util.ArrayList;
  2. class ChangeWords {
  3. public static void changeWords(char[] word1,String word2) {
  4. System.out.println(word1);
  5. for(int i = 0; i < word2.length();++i) {
  6. word1[i] = word2.charAt(i);
  7. System.out.println(word1);
  8. }
  9. }
  10.  
  11. public static void main(String[] args) {
  12. System.out.println("Input Output 1.)");
  13. changeWords("a fall to the floor".toCharArray(),"braking the door in");
  14. System.out.println();
  15. System.out.println();
  16. System.out.println("Input Output 2.)");
  17. changeWords("wood".toCharArray(),"book");
  18. System.out.println();
  19. System.out.println();
  20. System.out.println("Input Output 2.)");
  21. changeWords("floor".toCharArray(),"brake");
  22. System.out.println();
  23. System.out.println();
  24. }
  25. }
Success #stdin #stdout 0.05s 711168KB
stdin
Standard input is empty
stdout
Input Output 1.)
a fall to the floor
b fall to the floor
brfall to the floor
braall to the floor
brakll to the floor
brakil to the floor
brakin to the floor
brakingto the floor
braking o the floor
braking t the floor
braking ththe floor
braking thehe floor
braking the e floor
braking the d floor
braking the dofloor
braking the dooloor
braking the dooroor
braking the door or
braking the door ir
braking the door in


Input Output 2.)
wood
bood
bood
bood
book


Input Output 2.)
floor
bloor
broor
braor
brakr
brake