題目描述
從鍵盤上輸入一個(gè)字母,編寫程序,輸出與之對(duì)應(yīng)的ASCII編碼值。
輸入
輸入一個(gè)字母
輸出
輸出對(duì)應(yīng)的ASCII編碼值,提示信息格式如下: The ASCII of ‘字符’ is 對(duì)應(yīng)的ASCII編碼值.
樣例輸入1:
c
樣例輸出1:
The ASCII of ‘c’ is 99.
樣例輸入2:
B
樣例輸出2:
The ASCII of ‘B’ is 66.
import java.util.Scanner;public class Main { public static void main(String[] args) { // TODO 自動(dòng)生成的方法存根 Scanner in=new Scanner(System.in); String temp=null; int change_result=0; temp=in.nextLine(); char []chars=temp.toCharArray(); change_result=chars[0]; System.out.新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注