突然想学C#菜鸟一枚。求教。做一个简易计算器
I作为输出框本弱鸡编的程序为:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel...
I作为输出框本弱鸡编的程序为: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 计算器{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string str1 = A.Text; string str2 = B.Text; string str3 = C.Text; string str4 = D.Text; string str5 = L.Text; int num1 = Convert.ToInt32(str1); int num2 = Convert.ToInt32(str2); int num3 = Convert.ToInt32(str3); int num4 = Convert.ToInt32(str4); int num5 = Convert.ToInt32(str5); int num6 = num3 + num4; int num7 = num1 + num2; int num8 = num7 * num5; int result = num6 / num8; I.Text = Convert.ToString(result); } private void Form1_Load(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { } private void H_TextChanged(object sender, EventArgs e) { } }}求教输入L框输入0.98错误。然后结果要显示百分比。怎么搞啊。有没有师傅啊!0基础求教!
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询