程序
来源:互联网 发布:java 上午下午 编辑:程序博客网 时间:2024/04/25 08:14
//计算器
//作者:Jack.F
//时间:2010-3-21
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//作者:Jack.F
//时间:2010-3-21
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Counter
{
public partial class limiting : Form
{
public limiting()
{
InitializeComponent();
}
{
public partial class limiting : Form
{
public limiting()
{
InitializeComponent();
}
private void count_Click(object sender, EventArgs e)
{
Single a, b, result = 0;
a = Convert.ToSingle(num1.Text);
b = Convert.ToSingle(num2.Text);
switch (sign.SelectedItem.ToString())
{
case "+": result = a + b; break;
case "-": result = a - b; break;
case "*": result = a * b; break;
case "/": result = a / b; break;
}
Convert.ToSingle(result.Text);
{
Single a, b, result = 0;
a = Convert.ToSingle(num1.Text);
b = Convert.ToSingle(num2.Text);
switch (sign.SelectedItem.ToString())
{
case "+": result = a + b; break;
case "-": result = a - b; break;
case "*": result = a * b; break;
case "/": result = a / b; break;
}
Convert.ToSingle(result.Text);
}
}
}
}
}