Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.function.Function;
- public class Main {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- String[] line = scan.nextLine().split(" ");
- Function<String, Integer> parse = str -> Integer.parseInt(str);
- Integer[] newArr = new Integer[line.length];
- for (int i = 0; i < line.length; i++) {
- newArr[i] = parse.apply(line[i]);
- }
- for (Integer integer : newArr) {
- System.out.print(integer+" ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement