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