6-5

#include<stdio.h>

int main(void)

{

         char ch;

 

         printf("input characters:");

         ch=getchar();

         while(ch!='\n'){

                   if(ch>'A'&&ch<='z')

                            ch=ch-'A'+'a';

                   else if(ch>='a'&&ch<='z')

                            ch=ch-'a'+'A';

                   putchar(ch);

                   ch=getchar();

         }

         return 0;

}

 

posted @ 2013-10-06 15:24  zhaoyang16  阅读(117)  评论(0编辑  收藏  举报