Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Arrays;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- String a = in.nextLine();
- String[] b = a.split(" ");
- for (int i = 0; i < b.length - 1; i ++)
- if (b[i].length() > 0 || i ==0)
- System.out.print(b[i] + " ");
- System.out.print(b[b.length - 1]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement