for语句运用。

/* Note:Your choice is C IDE */
#include<stdio.h>
void main()
{
    char x='a';
    printf("please input ABC:");
    scanf("%c",&x);
    if( x>='A' && x<='Z')
    {
        x=x+32; printf("%c\n",x);
    }
    else if( x>='a' && x<='z')
    {
        x=x-32; printf("%c\n",x);
    }          
    else
    {    
        printf("input mistake");
    }
}
    getch();

 

posted @ 2016-10-17 12:45  凌公子666  阅读(102)  评论(0)    收藏  举报