采用indexOf()方法判断
判断是元音还是辅音
http://www.nowcoder.com/questionTerminal/7eb4df4d52c44d309081509cf52ecbc4
import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br =new BufferedReader(new InputStreamReader(System.in)); String str = null; String target = "AEIOUaeiou"; while((str = br.readLine()) != null) { char ch = str.charAt(0); if (target.indexOf(ch) != -1) { System.out.println("Vowel"); } else { System.out.println("Consonant"); } } br.close(); } }