代码拉取完成,页面将自动刷新
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Calcuator
{
class Figure
{
protected int _numOne;
private string _str1;
protected string Str1
{
get { return _str1; }
set { _str1 = value; }
}
public int NumOne
{
get { return _numOne; }
set { _numOne = value; }
}
protected int _numTwo;
private string _str2;
public string Str2
{
get { return _str2; }
set { _str2 = value; }
}
public int NumTwo
{
get { return _numTwo; }
set { _numTwo = value; }
}
protected char _character;
public char Character
{
get { return _character; }
set { _character = value; }
}
public void InPut()
{
NumOne = Convert.ToInt16(Console.ReadLine());//Convert.Int()里必须是数字
Character = Convert.ToChar(Console.ReadLine());
NumTwo = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("=");
}
public string Link()
{
Str1 = Console.ReadLine();
Character = Convert.ToChar(Console.ReadLine());
Str2 = Console.ReadLine();
if (Character == '+')
{
Str1 += Str2;
return Str1;
}
else if (Character == '-')
return Str1 = Str1.Replace(Str2, "");
else
return "字符串错误";
}
public double Count()
{
if (Character == '+')
{
return NumOne + NumTwo;
}
else if (Character == '-')
{
return NumOne - NumTwo;
}
else if (Character == '*')
{
return NumOne * NumTwo;
}
else if (Character == '/')
{
double d = (double)NumOne / NumTwo;
return d;
}
else return -1;
}
public bool Equals(int a, int b)
{
if (a == b)
return true;
else
return false;
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。