Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Digits {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String[] name = scanner.nextLine().split(",");
- List<String> listOne = Arrays.asList(name);
- List<Integer> intList = new ArrayList<>();
- for (String elem :listOne) {
- intList.add(Integer.parseInt(elem));
- }
- // System.out.println(intList);
- String[] name2 = scanner.nextLine().split(",");
- List<String> listTwo = Arrays.asList(name2);
- List<Integer> intListTwo = new ArrayList<>(intList);
- for (String elem2 :listTwo) {
- intListTwo.add(Integer.parseInt(elem2));
- }
- List<String> resultTwo = new ArrayList<>();
- for (Integer elem3 :intListTwo) {
- resultTwo.add(Integer.toString(elem3));
- }
- String result = String.join(",", resultTwo);
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement