java实现给出ASCII码对应的字符答案源码
package nameyu;import java.util.Scanner;public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner input=new Scanner(System.in); System.out.print("Enter an ASCII code:"); int number=input.nextInt(); if(number>=1&&number<=127){ char ch=(char)number; System.out.println("The character for ASCII code is :"+ch); } else System.exit(1); } }
页:
[1]