码迷,mamicode.com
首页 > 其他好文 > 详细

四则运算

时间:2015-10-06 23:29:28      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

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 WindowsFormsApplication1

{   

  public partial class Form1 : Form  

   {      

            public Form1()      

   {       

      InitializeComponent();   

      }

        private void button1_Click(object sender, EventArgs e)  

       {

            int i, x, y ;   

          x = int.Parse(textBox1.Text);   

          y = int.Parse(textBox2.Text);     

        i = x + y;    

         textBox4.Text = i.ToString();

                     

        }

        private void button2_Click(object sender, EventArgs e)

        {          

               int i, x, y;        

               x = int.Parse(textBox1.Text);   

          y = int.Parse(textBox2.Text);    

         i = x - y;      

       textBox4.Text = i.ToString();      

   }

        private void button3_Click(object sender, EventArgs e)      

   {

            int i, x, y;        

     x = int.Parse(textBox1.Text);     

        y = int.Parse(textBox2.Text);   

          i = x * y;       

      textBox4.Text = i.ToString();   

      }

        private void button4_Click(object sender, EventArgs e)   

      {

            int i, x, y;    

         x = int.Parse(textBox1.Text);     

        y = int.Parse(textBox2.Text);       

      i = x / y;      

       textBox4.Text = i.ToString();      

   }   

  }

}

四则运算

标签:

原文地址:http://www.cnblogs.com/louwentao/p/4857860.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!