HDU 1161 Eddy's mistakes(水~)

Description
给出一字符串,将其中的大写字母转化为小写字母后输出
Input
多组输入,每组用例占一行为一字符串,以文件尾结束输入
Output
对于每组用例,输出转化后的字符串
Sample Input
weLcOmE tO HDOj Acm 2005!
Sample Output
welcome to hdoj acm 2005!
Solution
水题
Code

#include<stdio.h>
#include<string.h>
int main()
{
    char s[1111];
    while(gets(s))
    {
        for(int i=0;s[i];i++)
            if(s[i]>='A'&&s[i]<='Z')
                s[i]+=32;
        puts(s);
    }
    return 0;
}

你可能感兴趣的:(HDU 1161 Eddy's mistakes(水~))