当前位置:网站首页>大小写字母转换
大小写字母转换
2022-07-23 05:44:00 【xiq1212】
代码如下:
#include <stdio.h>
int main(int argc,const char *argv[])
{
char a,b;
printf("请输入:");
scanf("%c",&a);
if(a>='A'&&a<='Z')
b=a+32;
else if(a>='a'&&a<='z')
b=a-32;
else
{
printf("输入的不是字母\n");
return -1;
}
printf("转换为:%c\n",b);
return 0;
}
运行结果:
[email protected]:~/test/c-day3$ ./a.out
请输入:A
转换为:a
[email protected]:~/test/c-day3$ ./a.out
请输入:g
转换为:G
[email protected]:~/test/c-day3$ ./a.out
请输入:4
输入的不是字母
边栏推荐
- C语言中,对柔性数组的理解
- Data analysis (I)
- 单片机学习笔记4--GPIO(基于百问网STM32F103系列教程)
- NLP natural language processing - Introduction to machine learning and natural language processing (I)
- 高电压技术-名词解释题
- Using or tools to solve the path planning problem (TSP)
- Object class
- Tips for using textviewdidchange of uitextview
- 单片机学习笔记3--单片机结构和最小系统(基于百问网STM32F103系列教程)
- 【AUTOSAR COM 2.通信协议栈进阶介绍】
猜你喜欢

【Autosar DEM 四.Event Memory】

论文解读:《基于BERT和二维卷积神经网络的DNA增强子序列识别transformer结构》

Using pycaret: low code, automated machine learning framework to solve regression problems

【AUTOSAR之FEE(非易失存储器Flash与Eeprom区别)】

Using Google or tools to solve logical problems: Zebra problem

How to develop the liquid cooled GPU server in the data center under the "east to West calculation"?

【基于UDS服务的BootLoader架构和刷写流程】

Interpretation of the paper: develop a prediction model based on multi-layer deep learning to identify DNA N4 methylcytosine modification

【AUTOSAR CanDrive 1.学习CanDrive的功能和结构】

Baidu Shen Shuo: focus on the scene, deeply cultivate the industry, and bring practical results to enterprise Digitalization
随机推荐
Interpretation of the paper: develop a prediction model based on multi-layer deep learning to identify DNA N4 methylcytosine modification
编码器的一点理解
Green data center: comprehensive analysis of air-cooled GPU server and water-cooled GPU server
Opencv library installation path (don't open this)
Interpretation of the paper: recognition of enhancer promoter interactions with neural networks based on pre trained DNA vectors and attention mechanisms
Solve Sudoku puzzles with Google or tools
3.2daydayup举一反三:三天打鱼两天晒网式学习
单片机学习笔记6--中断系统(基于百问网STM32F103系列教程)
把LVGL所有控件整合到一个工程中展示(LVGL6.0版本)
ARM架构与编程1--LED闪烁(基于百问网ARM架构与编程教程视频)
数据分析的重要性
#under指令
【AUTOSAR CanDrive 2.了解通信Hoh、CanId与PduID的Mapping关系】
钢结构基本原理全面详细总结
硬件知識1--原理圖和接口類型(基於百問網硬件操作大全視頻教程)
Connaissance du matériel 1 - schéma et type d'interface (basé sur le tutoriel vidéo complet de l'exploitation du matériel de baiman)
Tips for using textviewdidchange of uitextview
【Autosar DEM 四.Event Memory】
Interpretation of the paper: iterative feature representation method to improve the prediction performance of N7 methylguanosine (m7G) sites
线性规划之Google OR-Tools 简介与实战