Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Arrays;
- class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- int[] numbers = new int[n];
- char[] name;
- for (int i = 0; i < n; i++) {
- name = scanner.nextLine().toCharArray();
- for (char letter : name) {
- if ("aeiouAEIOU".indexOf(letter) != -1) {
- numbers[i] += letter * name.length;
- } else {
- numbers[i] += letter / name.length;
- }
- }
- }
- Arrays.sort(numbers);
- for (int number : numbers) {
- System.out.println(number);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement