📄 showcharvalue.java
字号:
// do-while循环
import java.io.*;
public class showCharValue
{
public static void main(String args[])
{
char ch;
try
{
System.out.println("请输入一个字符,以'#'结束");
do
{
ch = (char)System.in.read();
System.out.println("字符"+ch+"的整数值为"+(int)ch);
System.in.skip(2);//跳过回车键
}while(ch!='#');
}
catch(IOException e)
{
System.err.println(e.toString());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -