题解 | #判断是不是字母#

判断是不是字母

http://www.nowcoder.com/practice/91a588dd4cd244bfa616f17603ec123c

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String str;
        while((str=bf.readLine()) != null){
        char input = str.charAt(0);
        if( input >='A' && input <='Z' || input>='a' && input <= 'z'){
            System.out.println(input+" is an alphabet.");
        }else{
            System.out.println(input+" is not an alphabet.");
            }
        }
    }
}
全部评论

相关推荐

10-25 19:38
已编辑
门头沟学院 嵌入式工程师
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务