import java.util.Scanner; public class Demo_1 { public static void main(String[] args) { //输入的两个数字进行声明 int num1; int num2; //输入的计算符号 String s=""; //输入的需要使用的类 Scanner sc = new Scanner(System.in); System.out.println("欢迎使用巨无霸计算器"); //输入两个…
所选用的编译工具为NetBeans /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package jianpan2; /** * * @author Administrator */…
方法: 1.将string类型的表达式输入转换成后缀表达式 2.计算后缀表达式 步骤一:将string类型的表达式输入转换成后缀表达式 输入字符串表达式,并将表达式转换成char型数组 String a = "(5+5)*2-(4-2)/2"; char [] x = a.toCharArray(); Stack<Character> b = new Stack<>(); String back = "";//后缀表达式 后缀表达式实现 1.…