Ⅰ 输入两个数然后输入一个运算符计算出结果输出的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}