#include
void main()
{
char c;
printf(“请输入一个字符:\n”);
scanf("%c",&c);
if(c>=65 && c<=90)
{
c=c+32;
printf("转为小写是:%c\n",c);
}
else if(c>=97 && c<=122)
{
c=c-32;
printf("转为大写是:%c\n",c);
}
else
printf("输入的不是字母\n");
}
#include“stdio.h”
void main()
{
char c;
printf(“请输入一个字符:\n”);
scanf("%c",&c);
if(c>=65 && c<=90)
{
c=c+32;
printf("转为小写是:%c\n",c);
}
else if(c>=97 && c<=122)
{
c=c-32;
printf("转为大写是:%c\n",c);
}
else
printf("输入的不是字母\n");
}
#include
#include
int main(int argc, char* argv[])
{
char c;
putchar (isalpha(c=getchar())?islower(c)?toupper(c):tolower(c):c);
return 0;
}