FmCaculator.cs

(开头部分) 19KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    // 下载于www.51aspx.com
    public partial class FmCaculator : Form
    {
        private bool Mflag;
        private bool flag;
        private bool Rflag;//标志位,为true时用数据更新文本框而不是与框中原数据拼接
        public double M;
        private Stack<double> num;
        private Stack<char> ope;
        public bool precede(char c1)
        {
            if (ope.Count == 0) return true;
            char c2;
            c2 = ope.Peek();
            if (c2 == '*' || c2 == '/') return false;
            else if((c1=='+'&&c2=='+')||(c1=='+'&&c2=='-')||(c1=='-'&&c2=='+')||(c1=='-'&&c2=='-'))
            return false;
            else
            return true;
        }//判断优先级别
        public bool pointIntext()
        {
            for(int i=0;i<TxtResult.Text.Length;++i)
                if(TxtResult.Text[i].Equals('.'))
                    return true;
            return false;
        }//判断文本框中是否存在小数点
        public double calc(char c, double t1, double t2)
        {
            if (c == '+') return t1 + t2;
            else if (c == '-') return t1 - t2;
            else if (c == '*') return t1 * t2;
            else return t1 / t2;
        } //进行t1与t2的c符号运算
        public FmCaculator()
        {
            InitializeComponent();
            num=new Stack<double>();
            ope=new Stack<char>();
            flag = false;
            Mflag = false;
            Rflag = false;
        }//构造函数,各标志位置false
        private void BtNum1_Click(object sender, EventArgs e)
        {
            if (flag == true||Mflag==true||Rflag==true)
            {
                TxtResult.Text = BtNum1.Text;
                flag = false;
                Mflag = false;
后面还有 514 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。