;
public class Sort{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入第一个字符:");
String str1 = sc.next();
System.out.println("请输入第二个字符:");
String str2 = sc.next();
char c1 = str1.charAt(0);
char c2 = str2.charAt(0);
int asc1 = (int)c1;
int asc2 = (int)c2;
System.out.println("第一个字符" + str1 + "的ascii码是:" + asc1);
System.out.println("第二个字符" + str2 + "的ascii码是:" + asc2);
if(asc1 > asc2){
System.out.println("大的是:" + str1);
}else{
System.out.println("大的是:" + str2);
}
}
}
收费代工. 谢谢.
收费的要。谢谢