📄 ifswitchtest.java
字号:
/**
* Java语言实验参考程序
* Company 北京师范大学计算机系
* @author 孙一林
* @version 1.0
*/
import java.io.*;public class IfSwitchTest { public static void main(String[] args) throws IOException { char c_Ch; System.out.println("Input a Number:"); c_Ch = (char)System.in.read(); if(( 0x39 >= c_Ch ) && (c_Ch >= 0x30)){ // 判断0~9键 System.out.println("The Number is 0~9 Key "); switch(c_Ch){ // 0~9分支 case '0':System.out.println("The Number is 0 Key "); break; case '1':System.out.println("The Number is 1 Key "); break; case '2':System.out.println("The Number is 2 Key "); break; case '3':System.out.println("The Number is 3 Key "); break; case '4':System.out.println("The Number is 4 Key "); break; case '5':System.out.println("The Number is 5 Key "); break; case '6':System.out.println("The Number is 6 Key "); break; case '7':System.out.println("The Number is 7 Key "); break; case '8':System.out.println("The Number is 8 Key "); break; case '9':System.out.println("The Number is 9 Key "); break; } } else{ System.out.println("The Number is an Other Key "); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -