Problem C: 更改大小写

#include<stdio.h>
int main()
{
    int i=0;
    char a[80];
    gets(a);
    while(a[i]!='\0')
    {
        if(a[i]>='a' && a[i]<='z') a[i]-=32;
        ++i;
    }
    printf("%s",a);
    return 0;
}

 

posted @ 2018-11-08 19:58  MichaelCecil  阅读(900)  评论(0编辑  收藏  举报