Eddy's mistakes
composition, the writing length does not surpass 1000 characters.
weLcOmE tO HDOj Acm 2005!
welcome to hdoj acm 2005!
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
char ch;
while(~scanf("%c",&ch)&&ch!='\n') //很奇葩的写法,慢慢理解~
{
if(ch>='A'&&ch<='Z') printf("%c",ch+32); //注意此处
else printf("%c",ch);
while(~scanf("%c",&ch)&&ch!='\n')
{
if(ch>='A'&&ch<='Z') printf("%c",ch+32);
else printf("%c",ch);
}
printf("\n");
}
return 0;
}
#include <stdio.h>
#include <string.h>
int main()
{
char s[1010];
while(gets(s)) //此题输入的字符串有空格,所以用gets()
{
for(int i=0;s[i]!='\0';i++)
{
if(s[i]>='A'&&s[i]<='Z') printf("%c",s[i]+32);
else printf("%c",s[i]);
}
printf("\n");
}
return 0;
}