c语言--数入小写字母转换为大写字母,输入大写字母转换为小写,输入数字不输出。

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/gdarg/article/details/89600937

今天能做完的事,绝不拖到明天----苏步青

#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int ch = 0;
	printf("请输入一个字符:\n");
	while ((ch = getchar()) != EOF)
	{
		if (ch >= 'a'&&ch <= 'z')
		{
			printf("%c\n", ch - 32);
		}
		else if (ch >= 'A'&&ch <= 'Z')
		{
			printf("%c\n", ch + 32);
		}
		else if (ch >= '0'&&ch <= '9')
		{
			;
		}
	}
	system("pause");
	return 0;
}

猜你喜欢

转载自blog.csdn.net/gdarg/article/details/89600937