#include<stdio.h>
#include<string.h>
int main(void)
{
int i,k;
char Words[100];
printf("Please input a string of words:\n");
gets(Words);
k=strlen(Words);
for(i=0;i<k;i++)
{
if('A'<=Words[i]&&Words[i]<='Z')
Words[i]=Words[i]+32;
else if('a'<=Words[i]&&Words[i]<='z')
Words[i]=Words[i]-32;
}
printf("The new string is:\n");
puts(Words);
}
这个可以比较简单