【00】新的开始


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt();
        String str=sc.next();
        char c=str.charAt(0);
        int b= sc.nextInt();
        switch (c){
            case '+':
                System.out.println(a+b);break;
            case '-':
                System.out.println(a-b);break;
            case '*':
                System.out.println(a*b);break;
            case '/':
                System.out.println((double) a/b);break;
            default:
                System.out.println("输入运算符号不合法!");
        }
        sc.close();
    }

}
posted @ 2021-06-07 18:43  bobochen  阅读(47)  评论(0)    收藏  举报