题解 | #字母大小写转换#
字母大小写转换
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());
}
}
}
}