Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int lines = Integer.parseInt(scanner.nextLine());
- String input = "";
- String least = "";
- String secondLeast = "";
- int vowelCounter = 0;
- int lowestVowel = Integer.MAX_VALUE;
- for (int i = 0; i < lines; i++) {
- input = scanner.nextLine();
- for (int j = 0; j < input.length(); j++) {
- if (input.charAt(j) == 'a' || input.charAt(j) == 'o' || input.charAt(j) == 'u' || input.charAt(j) == 'e' || input.charAt(j) == 'i') {
- vowelCounter++;
- }
- }
- if (lowestVowel > vowelCounter) {
- lowestVowel = vowelCounter;
- least = input;
- secondLeast = least;
- }
- if (vowelCounter == lowestVowel && input.length() > least.length()) {
- secondLeast = input;
- }
- if(least.length() < secondLeast.length()){
- least = secondLeast;
- }
- }
- System.out.println(secondLeast + " " + lowestVowel + "/" + secondLeast.length());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement