题目来源:牛客网 编程初学者入门训练 BC47 判断是不是字母
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
String str = sc.next();
int c = (int)str.charAt(0);
if((c >= 65 && c <= 90) || (c >= 97 && c <= 122)) {
System.out.println(str.charAt(0) + " is an alphabet.");
} else {
System.out.println(str.charAt(0) + " is not an alphabet.");
}
}
}
}