您的位置:首页 > 其它

HDOJ 1161 Eddy's mistakes (大小写转换)

2015-09-22 20:59 411 查看

Eddy's mistakes

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)

Total Submission(s): 9154 Accepted Submission(s): 5156

[align=left]Problem Description[/align]
Eddy usually writes articles ,but he likes mixing the English letter uses, for example "computer science" is written frequently "coMpUtEr scIeNce" by him, this mistakes lets Eddy's English teacher be extremely discontentment.Now please
you to write a procedure to be able in the Bob article English letter to turn completely the small letter.

[align=left]Input[/align]
The input contains several test cases.each line consists a test case,Expressed Eddy writes in an article , by letter, blank space,numeral as well as each kind of punctuation

composition, the writing length does not surpass 1000 characters.

[align=left]Output[/align]
For each test case, you should output an only line, after namely the result of transforms the lowercase letter.

[align=left]Sample Input[/align]

weLcOmE tO HDOj Acm 2005!


[align=left]Sample Output[/align]

welcome to hdoj acm 2005!


注 - 此题为 : HDOJ 1161 Eddy's mistakes (大小写转换)

由于输入有空格,要用 gets 读入

已AC代码:

#include<cstdio>
#include<cstring>
int main()
{
char ch[1100];
while(gets(ch))
{
int i,len;
len=strlen(ch);

for(i=0;i<len;++i)
if(ch[i]>='A'&&ch[i]<='Z')
ch[i]+=32;

printf("%s\n",ch);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: