ifswitchtest.java
来自「递归子程序法:对应每个非终结符语法单元编一个独立的处理过程(或子程序)。语法分析」· Java 代码 · 共 44 行
JAVA
44 行
/**
* 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 + =
减小字号Ctrl + -
显示快捷键?