public const int NULL = 0; // 定义操作码 public const int ADD = 1; //表示加 public const int SUB = 2; //减 public const int MUL = 3; //乘 public const int DIV = 4; //除 public const int SQR = 5; //求平方 public const int SQRT = 6; //求平方根 public const int NODOT = 0; // 定义是否点击了小数点,0 为没点 public const int HASDOT = 1; private double res = 0; // 记录结果数 private double tmp = 0; // 当前输入的操作数 private int opt = NULL; // 记录操作码 private int dot = NODOT; // 记录是否点击了小数点,0为没有点 private int num = 0; // 记录输入操作数的个数 private int dotnum = 0; // 记录小数点部分的个数 string strOper; //获取操作符 #endregion /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); }