SHOW:
|
|
- or go back to the newest paste.
| 1 | package com.company; | |
| 2 | ||
| 3 | import java.util.Arrays; | |
| 4 | import java.util.Scanner; | |
| 5 | ||
| 6 | public class EncryptSortAndPrintArray {
| |
| 7 | public static void main(String[] args) {
| |
| 8 | Scanner scanner = new Scanner(System.in); | |
| 9 | ||
| 10 | int number = Integer.parseInt(scanner.nextLine()); | |
| 11 | int[] numbers = new int[number]; | |
| 12 | ||
| 13 | for (int i = 0; i < number; i++) {
| |
| 14 | String names = scanner.nextLine(); | |
| 15 | int sum = 0; | |
| 16 | ||
| 17 | for (int j = 0; j < names.length() ; j++) {
| |
| 18 | char name = names.charAt(j); | |
| 19 | ||
| 20 | if(name=='a' || name=='A' || name=='e' || name=='E' || name=='i' | |
| 21 | || name=='I' || name=='o' || name=='O' || name=='u' || name=='U') {
| |
| 22 | ||
| 23 | sum += name * names.length(); | |
| 24 | } else {
| |
| 25 | sum += name / names.length(); | |
| 26 | } | |
| 27 | } | |
| 28 | numbers[i] = sum; | |
| 29 | } | |
| 30 | Arrays.sort(numbers); | |
| 31 | for (int index:numbers) {
| |
| 32 | System.out.println(index); | |
| 33 | } | |
| 34 | } | |
| 35 | } | |
| 36 |