作者:chen-yu2502881617 | 来源:互联网 | 2023-05-17 14:20
调用toupper()函数#define_CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>voidto
调用toupper()函数
#define _CRT_SECURE_NO_WARNINGS
#include
#include
void toupper(char ch)
{
if (ch >= 'a'&&ch <= 'z')
{
printf("%c\n", ch - 32);
}
else
{
printf("%c\n", ch + 32);
}
}
int main()
{
char ch;
scanf("%c", &ch);
toupper(ch);
system("pause");
return 0;
}
随机输入大写字母,程序输出小写字母或者随机输入小写字母,程序输出大写字母