2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > 键盘输入 大写字母变小写 小写变大写

键盘输入 大写字母变小写 小写变大写

时间:2021-05-05 20:42:10

相关推荐

键盘输入 大写字母变小写 小写变大写

.编写一个程序,可以一直接收键盘字符,

如果是小写字符就输出对应的大写字符,

如果接收的是大写字符,就输出对应的小写字符,

如果是数字不输出。

#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>#include<string.h>void conversion() {char input, output;while (1) {scanf("%c", &input);//input = getchar(); 两种输入方法均可printf("\n");if (input <= 90 && input >= 65) {output = input + 32;printf("变换后:%c\n", output);}if (input <= 122 && input >= 97) {output = input - 32;printf("变换后:%c\n", output);}}}int main() {conversion();system("pause");return 0;}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。