其他分享
首页 > 其他分享> > 2021-11-01

2021-11-01

作者:互联网

Computers understand only numbers, so every character has a numeric representation.
The program you are given takes a character as input. Write a program to output its numeric value.

Sample Input
a

Sample Output
97

//Java 
import java.util.Scanner;

class Main {
   public static void main(String[] args) {
       Scanner read = new Scanner(System.in);
       char a = read.next().charAt(0);
       
       //your code goes here
       
       int b =(int)a;
       System.out.println(b);
    }   
}

标签:11,01,Scanner,int,character,System,numeric,program,2021
来源: https://blog.csdn.net/melanie_fay/article/details/121076129