Hdu 1161
来源:互联网 发布:担保交易网站源码 编辑:程序博客网 时间:2024/05/22 13:40
Eddy’s mistakes
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 11202 Accepted Submission(s): 6312
Problem Description
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.
Input
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.
Output
For each test case, you should output an only line, after namely the result of transforms the lowercase letter.
Sample Input
weLcOmE tO HDOj Acm 2005!
Sample Output
welcome to hdoj acm 2005!
题意:将短句中的大写字母转换为小写
import java.util.Scanner;public class Main { /* *自己写的方法,可以调用java自带的方法toLowerCase(); *也能AC,不过源码比较复杂,考虑的比较多,建议自己写 */ public static char[] toLower(char[] s1){ for(int i=0;i<s1.length;i++){ if(s1[i]>='A' && s1[i]<='Z') s1[i] = (char) (s1[i] + 32); } return s1; } public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNextLine()){ String str = in.nextLine(); char[]str1 = toLower(str.toCharArray()); for(int i=0;i<str1.length;i++){ System.out.print(str1[i]); } System.out.println(); } }}
- hdu 1161
- HDU 1161
- Hdu 1161
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- HDU
- Hdu
- hdu
- hdu-
- hdu
- HDU 3944 DP? 【组合数取模+阶乘预处理】
- mysql利用双重url编码绕过防火墙
- toast
- php导出excel(多种方法)
- 欢迎使用CSDN-markdown编辑器
- Hdu 1161
- 学习FreeRTOS(1):实验环境
- Js代码和Java代码之间的互相调用了
- 学习笔记
- 表格的简单实现_1
- 1
- Leetcode 69. Sqrt(x)
- vs 程序的远程屏幕监控、远程截图、本地截图。
- 得到应用发送与接收的流量