调用toupper()函数
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
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;
}
随机输入大写字母,程序输出小写字母或者随机输入小写字母,程序输出大写字母