Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Arrays;
- public class SoftUni {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.print("Enter your numbers here(separated with spaces): ");
- String values = sc.nextLine();
- String[] items = values.split(" ");
- int[] arr = Arrays.stream(items).mapToInt(e -> Integer.parseInt(e)).toArray();
- for(int l = 0;l<arr.length;l++){
- System.out.print(arr[l] + " ");
- }
- }
- }
Add Comment
Please, Sign In to add comment