?? switchop1.java
字號:
//SwitchOp1.java
//根據不同的四則運算符(+、-、*、/),對兩個實數執行相應的運算并輸出結果。
public class SwitchOp1
{
public static void main(String args[])
{
float a=9;
float b=3;
float result=0;
char op='+';
switch(op)
{
case '+': result=a+b;
case '-': result=a-b;
case '*': result=a*b;
case '/': result=a/b;
default: result=0;
}
System.out.println("result="+result);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -