当前位置:网站首页>ZZULIOJ:1026: 字符类型判断
ZZULIOJ:1026: 字符类型判断
2022-08-10 03:39:00 【追上】
1026: 字符类型判断
时间限制: 1 Sec 内存限制: 30 MB
[状态] [讨论版] [提交] [命题人:admin]
题目描述
从键盘输入一个字符,判断该字符是否大写字母、小写字母、数字字符或其他字符。分别输出对应的提示信息。
输入
输入一个字符。
输出
如果该字符是大写字母,则输出“upper”;若是小写字母,则输出“lower”;若是数字字符,则输出“digit”;若是其他字符,则输出“other”。(输出不含双引号)。
样例输入 Copy
E
样例输出 Copy
upper
提示
本题在课程网站上有专题讲解,第二章的边讲边写:银行利率——单利复利、数学函数
https://www.icourse163.org/learn/ZZULI-1206704833?tid=1465320443#/learn/content?type=detail&id=1245627017&cid=1270742060
参考代码
#include <stdio.h>
int main()
{
char ch;
ch=getchar();
if(ch>='a'&&ch<='z')
printf("lower");
else if(ch>='A'&&ch<='Z')
printf("upper");
else if(ch>='0'&&ch<='9')
printf("digit");
else printf("other");
return 0;
}
边栏推荐
猜你喜欢
maya图片如何导入
leetcode-218.天际线问题
matlab simulink response spectrum calculation
Did not detect default resource location for test class xxxx
RoyalScope分析仪:CAN总线波形台阶和信号幅值低的问题
【MindSpore】在训练过程中的step代表什么?
Dijkstra求最短路
Embedded Sharing Collection 32
Difference between netstat and ss command
The same is a primary test, why does he pay 5,000 yuan more than me?
随机推荐
mediaserver创建
【网络迁移】Pytorch中的F.interpolate对应MindSpore哪个方法
Pytorch中的torch.index_select对应MindSpore哪个方法
Basic understanding of network models
【科研绘图】琴图 +箱型图混合 matplotlib库和seabsorn库的使用
netstat和ss命令区别
数据库设计中反映用户对数据要求的模式叫什么
线程和线程间通信(C语言)
Flutter 如何安装 pub.dev 上的 package
留言板
torch.nn.CrossEntropyLoss()对应的MindSpore算子是哪个?
TCP协议之《QUICKACK模式》
使用 requestAnimationFrame 提升 web 性能
自定义训练,使用Generator dataset迭代数据报错
golang:base64编解码(转)
charles的功能操作
sql注入之宽字节注入,limit,order by
【Verilog数字系统设计(夏雨闻)6-------模块的结构、数据类型、变量和基本运算符号2】
TCP协议之《TSQ控制》
【mindspore】【Categorical】softmax数据放入Categorical类出现和不为1的错误