编写程序,输⼊⼀个字符,判断它是否为⼩写字母,如果是,将它转化成⼤写字母,否则,不转换 import java.io.IOException;public class ZhiFuChuan { public static void main(String[] args)throws IOException{ char ch = (char)System.in.read();if(ch >='a'&&ch <='z'){ ch -=32;} System....
public static void main(String[] args)throws IOException{ char ch = (char)System.in.read(); if(ch >='a'&&ch <='z'){ ch -=32; } System.out.println("判断结果:"+ch); } }
import java.util.Scanner;publicclassTest1 {publicstaticvoidmain(String[] args){ Scanner sc=newScanner(System.in); System.out.println("请输入一串字母:"); String line=sc.nextLine();char[] arr=line.toCharArray();for(inti=0;i<arr.length;i++){chartemp;if(arr[i]>=97&& arr[i]<=122){ ...
public static void main(String[] args) { Scanner scanner = new Scanner(System.in);System.out.println("请输入一个字母");char aChar = scanner.nextLine().charAt(0);System.out.println(convertLowerCase(aChar));} / 接收一个字符,如果为小写则转换为大写, 大写则不改变 param aChar ...