当前位置:网站首页>大小写字母转换
大小写字母转换
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
输入的不是字母
边栏推荐
- 论文解读:《基于BERT和二维卷积神经网络的DNA增强子序列识别transformer结构》
- 钢结构基本原理题库
- Under the "double carbon" goal of the digital economy, why does the "digital East and digital West" data center rely on liquid cooling technology to save energy and reduce emissions?
- 高分子合成工艺学复习考题
- 高分子物理考研概念及要点、考点总结
- 钢结构基本原理试题及答案
- [AUTOSAR cantp 1. learn the network layer protocol of UDS diagnosis]
- Data mining scenario - false invoice
- 利用or-tools来求解路径规划问题(TSP)
- 【AUTOSAR CanTP 1.学习UDS诊断的网络层协议】
猜你喜欢

线性规划之Google OR-Tools 简介与实战

Six trends and eight technologies of high-performance computing in data centers under "data center white paper 2022" and "computing from the east to the west"

Integrate all lvgl controls into one project (lvgl6.0 version)

Interpretation of the paper: recognition of enhancer promoter interactions with neural networks based on pre trained DNA vectors and attention mechanisms

Using or tools to solve the path planning problem with capacity constraints (CVRP)

单片机学习笔记7--SysTick定时器(基于百问网STM32F103系列教程)

利用or-tools来求解路径规划问题(VRP)

高等代数知识结构

时间序列的数据分析(三):经典时间序列分解

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)
随机推荐
C语言中,对柔性数组的理解
[CAN总线的物理层 ]1.CAN/CANFD采样的点的内容分享
深度学习-神经网络
高等代数100道题及答案解析
Using pycaret for data mining: association rule mining
单片机学习笔记1--资料下载、环境搭建(基于百问网STM32F103系列教程)
Deep learning neural network
【AUTOSAR CanDrive 2.了解通信Hoh、CanId与PduID的Mapping关系】
预处理指令#define,你真的懂了吗?
把LVGL所有控件整合到一个工程中展示(LVGL6.0版本)
高电压技术试题及答案
Interpretation of the paper: DNA enhancer sequence recognition transformer structure based on Bert and two-dimensional convolutional neural network
单片机学习笔记5--STM32时钟系统(基于百问网STM32F103系列教程)
Interpretation of the paper: "bert4bitter: a basic model for improving bitter peptide prediction based on transformer (BERT) bidirectional encoder representation"
Hardware knowledge 1 -- Schematic diagram and interface type (based on Baiwen hardware operation Daquan video tutorial)
Use pyod to detect outliers
线性规划之Google OR-Tools 简介与实战
[AUTOSAR candrive 1. learn the function and structure of candrive]
#under指令
With statement