题解 | #判断是不是字母#
判断是不是字母
http://www.nowcoder.com/practice/91a588dd4cd244bfa616f17603ec123c
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNext()){ String str = in.nextLine(); if(str.substring(0,1).matches("[a-zA-Z]")){ System.out.println(str.charAt(0)+" is an alphabet."); }else{ System.out.println(str.charAt(0)+" is not an alphabet."); } } } }