Ⅰ 輸入兩個數然後輸入一個運算符計算出結果輸出的java程序怎麼寫
import java.util.Scanner;x0dx0ax0dx0apublic class Test {x0dx0a public static void main(String[] args) {x0dx0a Scanner input=new Scanner(System.in);x0dx0a System.out.println("輸入第一個數");x0dx0a double x=input.nextDouble();x0dx0a System.out.println("輸入第二個數");x0dx0a double y=input.nextDouble();x0dx0a System.out.println("輸入運算符");x0dx0a String op=input.next();x0dx0a if ("+".equals(op)) {x0dx0a System.out.println("結果是:租念嫌高茄"+(x+y));x0dx0a }else if ("-".equals(op)) {x0dx0a System.out.println("結果弊手是:"+(x-y));x0dx0a }else if ("*".equals(op)) {x0dx0a System.out.println("結果是:"+(x*y));x0dx0a }else if ("/".equals(op)) {x0dx0a System.out.println("結果是:"+(x/y));x0dx0a }else {x0dx0a System.out.println("出現異常");x0dx0a }x0dx0a }x0dx0ax0dx0a}