如何添加到下面的现有程序中?我需要能够找到辅音、单词、空格和特殊字符的数量。我已经有元音了?
import java.lang.String;
import java.io.*;
import java.util.*;
public class CountVowels
{
public static void main(String args[])throws IOException
{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the String:");
String text = bf.readLine();
int count = 0;
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (c=='a' || c=='e' || c=='i' || c=='o' || c=='u') {
count++;
}
}
System.out.println("The number of vowels in the given sentence are " + count);
}
}