欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

c 将大写字符转换为小写字符

最编程 2024-10-15 15:35:04
...

直接上代码

Method1:

#include<stdio.h>
int main() {
	char input,output;
	scanf("%c",&input);
	output = input + 32;
	printf("%c\n",output);
	return 0;
}

Method2:

#include<stdio.h>
int main() {
	char input,output;
	scanf("%c",&input);
	output = input + ('a' -'A');
	printf("%c\n",output);
	return 0;
}

推荐阅读