参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); scanner.nextLine(); while(n-- != 0) { String s = scanner.nextLine(); String s1 = s.substring(0, 1).toUpperCase(); String s2 = s.substring(1).toLowerCase(); String res = s1 + s2; System.out.println(res); } } }
0.0分
4 人评分