String[] letters = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "L"};
Scanner inp = new Scanner(System.in);
String input = (inp.nextLine());
String[] cord = input.split("");
for(int x = 0; x < 10; x++)
if(letters[x] == cord[1])
System.out.println("Fk yeah!");
为什么FK呀!如果我输入A-L字母之一,就不会发生?字符串不等于字符串?
你确定'cord'实际上只是字母而没有空白吗? – 2011-08-20 00:43:50
也可以是大写与小写 – Jody
是的,我相信100%。不,他们都是大写。 –