Scanner sc = new Scanner(System.in);
String str = sc.next();
int a = 0;
int b = 0;
for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) == 'a' || str.charAt(i) == 'e' || str.charAt(i) == 'i' || str.charAt(i) == 'o'
|| str.charAt(i) == 'u') {
a++;
} else {
b++;
}
}
System.out.println(a);
System.out.println(b);
## 问题描述
给定一个单词,请计算这个单词中有多少个元音字母,多少个辅音字母。
元音字母包括 a,e,i,o,u,共五个,其他均为辅音字母。输入格式
输入一行,包含一个单词,单词中只包含小写英文字母。输出格式
输出两行,第一行包含一个整数,表示元音字母的数量。
第二行包含一个整数,表示辅音字母的数量。
样例输入
lanqiao
样例输出
4
3