@[csdn](计算机)
1![在这里插入图片描述]计算机页面.PNG
# 以下是详细内容;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 计算器
{
public partial class Form1 : Form
{
//HasDot表示有没有小数点,false位默认值,表示没有
bool HasDot = false;
//HasOption表示有没有选择运算符,默认是没有的false
bool HasOption = false;
string Option ;
//存储第一个运算或者存储上一次运算的结果
decimal OptionNumber = 0;
public Form1()
{
InitializeComponent();
}
//btnZero为0
private void btnZero_Click(object sender, EventArgs e)
{
OptionNumber = Convert.ToDecimal(txtResult.Text);
if (HasDot || OptionN