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; }
相关文章推荐
- java集合框架(上)
- eclipse中使用git
- 系列文章--Python Web编程
- uva 1151(最小生成树,枚举子集)
- URAL 1106 Two Teams
- No persistence.xml file found in project
- Light oj 1105 - Fi Binary Number(计数)
- 对话海尔CEO张瑞敏
- Linux C中内联汇编的语法格式及使用方法
- Android推送服务(使用第三方api需要注意的地方)
- mysql常用语句1
- spark on yarn
- (4.4.1.8) android垃圾回收机制及程序优化System.gc
- LeetCode(38) Delete Node in a Linked List
- CVBS信号解析
- 数据结构与算法分析第二章12题
- 随想
- 附加题1—— 我想搞懂的软工问题
- IO流-文件管理
- ListBox控件绑定数据源