Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class _2_Illuminati {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner scan = new Scanner(System.in);
- String message = scan.nextLine().toUpperCase();
- int vowelsCounter = 0;
- int sumOfVowels = 0;
- char[] messageArr = message.toCharArray();
- for (char ch : messageArr) {
- if (ch == 65 || ch == 69 || ch == 73 || ch == 79 || ch == 85) {
- vowelsCounter++;
- sumOfVowels += ch;
- }
- }
- System.out.println(vowelsCounter);
- System.out.println(sumOfVowels);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement