题解 | #判断是不是字母#
判断是不是字母
http://www.nowcoder.com/practice/91a588dd4cd244bfa616f17603ec123c
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext())
{
char c=sc.next().charAt(0);
if(c>=65&&c<=90||c>=97&&c<=122)
{
System.out.println(c+" is an alphabet.");
}else{
System.out.println(c+" is not an alphabet.");
}
}
}
}
查看22道真题和解析