题解 | #字母大小写转换#

字母大小写转换

http://www.nowcoder.com/practice/850ebd30a2a34cfc87199da3fc15786a

import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNextLine()) {
            String str = scan.nextLine();
            if(str.matches("[a-z]")) {
                System.out.println(str.toUpperCase());
            } else {
                System.out.println(str.toLowerCase());
            }
        }
    }
}
全部评论

相关推荐

07-08 13:48
门头沟学院 C++
点赞 评论 收藏
分享
06-07 12:20
新余学院 Java
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务