05. Top Integers Arrays
някой може ли да ми каже къде ми е грешката
import java.util.Arrays;
import java.util.Scanner;
public class treasureHunt {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int [] numbers = Arrays
.stream(scanner.nextLine().split(" "))
.mapToInt(Integer::parseInt)
.toArray();
for (int index = 0; index < numbers.length ; index++) {
int currentNum = numbers[index];
int rightSum = 0 ;
for (int i = index + 1; i <= numbers.length - 1 ; i++) {
rightSum = numbers[i];
}
if (currentNum > rightSum){
System.out.printf("%d ",currentNum);
continue;
}
}
}
}