题目举例:Hello, world!
首先保证是数
然后在前面加上 (char) 就行了。
例如上题解答:
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNext()) {
String str = in.next();
System.out.print((char)Integer.parseInt(str));
}
}
}