Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
example_20.c 509 Bytes
Copy Edit Raw Blame History
武小弟 authored 2021-04-09 18:29 . git add
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
/*
C 语言实例 - 判断字母
*/
int main20()
{
char ch;
printf("请输入一个字符");
scanf("%c", &ch);
if (ch>='a' && ch<='z '|| ch >= 'A' && ch <= 'Z' )
{
printf("%c字符为字母类型",ch);
}
else
{
printf("%c字符不是字母类型",ch);
}
}
#include <stdio.h>
int main20_02() {
char c;
printf("请输入一个字符:");
scanf("%c", &c);
((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) ? printf("%c是字母", c) : printf("%c不是字母", c);
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化