利用JAVA程序查询字母在电脑中的的ASCII值
public class Demo {
public static void main(String[] args) {
while (true) {
Scanner sc = new Scanner(System.in);
System.out.println("**********欢迎来到计算机底层各字符ASSIC查询小程序**********");
System.out.print("请输入一个字母(区分大小写),以输出其ASSIC值:");
String s = sc.next();
char c = s.charAt(0);
int a = 10;
int d = a + c;
System.out.println("正在查询中,请稍后......");
System.out.print("字符" + c + "的ASSIC值为:");
System.out.println(d - a);
System.out.println();
System.out.println("*********退出程序请按0*********"+"否则按1继续查询**********");
int t =sc.nextInt();
if (t==0){
break;
}
else{
continue;
}
}
}
}

浙公网安备 33010602011771号