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!");
如果我输入A-L字母中的任意一个,为什么就不能出现 Fk yeah!?
cord
只是一个字母而且没有空格吗? - user195488compareTo
而不是==
。 - Suhail Gupta