#include<stdio.h> main() {char s[];int i=0;for(i=0;;i++)scanf("%c"*s[i]);for (i=0;s[i]!='/0';i++){if(s[i]>='A'&&s[i]<='Z')s[i]+=32;/将大写字母改为小写elseif(s[i]>='a'&&s[i]<='z')/将小写改为大写s[i]-=32;}printf("%c",s[]);}
#include<stdio.h> main() { char c; while((c=getchar())!='\n') { if(c>='a'&&c<='z') c=c-32; else if(c>='A'&&c<='Z') c=c+32; printf("%c",c);}printf("\n");}经本人亲自编写并测试,如有不懂请Q我172610236
deal(char str[]){while (*str != 0) {if (isupper(*str)) { *str = toupper(*str); }else { *str = tolower(*str); }str++;}}
------------------------------------经过运行#include<stdio.h>main(){char a[100];//最多输入100个字符int i,j;printf("plsea input a[].\n");gets(a);for(i=0;a[i]!='\0';i++){ if(a[i]>='a' && a[i]<='z') a[i]=a[i]-32;else if(a[i]>='A' && a[i]<='Z') {a[i]=a[i]+32;continue;}}for(i=0;a[i]!='\0';i++)printf("%c",a[i]);printf("\n");}