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);
    }   
}
上一篇:某系统的数字密码,比如1983,采用加密方式进行传输,规则如下:先得到每位数,然后每位数都加上5 , 再对10求余,最后将所有数字反转,得到一串新的数字


下一篇:学习markdown语法