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