public static void main(String[] args) { Scanner sc=new Scanner(System.in); String str=sc.nextLine(); System.out.println("ASCII码"+(str.charAt(0)+0)+" 转换为大写 " +Character.valueOf((char) (str.charAt(0)-32))); }输出aASCII码97转换为大写 A