Monika_Monova

CombineLists

Aug 2nd, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import java.util.Arrays;
  2. import java.util.Scanner;
  3.  
  4. public class Main {
  5.  
  6. public static void main(String[] args) {
  7. // write your code here
  8.  
  9. Scanner sc = new Scanner(System.in);
  10. String line1 = sc.nextLine();
  11. String line2 = sc.nextLine();
  12. String[] input1 = line1.split(",");
  13. String[] input2 = line2.split(",");
  14. String result = new String();
  15. for (int i = 0; i < input1.length; i++) {
  16. result = result + input1[i] + input2[i];
  17.  
  18. }
  19.  
  20.  
  21.  
  22. System.out.println(String.join(",",result));
  23.  
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment