题解 | #判断是不是字母#
判断是不是字母
https://www.nowcoder.com/practice/91a588dd4cd244bfa616f17603ec123c
#include <stdio.h> int main() { char input = '\0'; while ((input = getchar()) != EOF)//一次从键盘上获取一个字符,并判断是否获取成功 { if ((input >= 'a'&&input <= 'z') || (input >= 'A'&&input <= 'Z')) { printf("%c is an alphabet.\n", input); } else { printf("%c is not an alphabet.\n", input); } getchar();//获取第一次输入的值和第二次输入的值中间的回车键 } return 0; }