题解 | #判断是不是字母#
判断是不是字母
https://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(Character.isLetter(c)){
System.out.println(c+" is an alphabet.");
} else {
System.out.println(c+" is not an alphabet.");
}
}
}
}
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(Character.isLetter(c)){
System.out.println(c+" is an alphabet.");
} else {
System.out.println(c+" is not an alphabet.");
}
}
}
}