Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.util.stream.Collectors;
- public class findTheSmallest {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- ArrayList<Integer> numbers = Arrays.stream(scan.nextLine().split("\\s+"))
- .mapToInt(Integer::parseInt).boxed().collect(Collectors.toCollection(ArrayList::new));
- System.out.println(numbers.lastIndexOf(numbers.stream().mapToInt(e -> e).min().getAsInt()));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment