zoukankan      html  css  js  c++  java
  • C#

    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 form11
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            private void button2_Click(object sender, EventArgs e)
            {
                Close();

            }

            private void button1_Click(object sender, EventArgs e)
            {
              
              
                    //Console.WriteLine("输入两个数:");
                    int Q, R,i;
                    Q = int.Parse(textBox1.Text);
                    R = int.Parse(textBox2.Text);
           
                  
                if(Q!=R)
                {

                    for (i = 0; Q != R;i++ )
                        if (Q > R)
                        {
                            Q = Q - R;
                        }
                        else
                        {
                            R = R - Q;
                        }

                    label1.Text = ((int.Parse(textBox1.Text)) + "和" + (int.Parse(textBox2.Text)) + "的最大公倍数是:" + Q);
                }
                else
                {
                    label1.Text = ((int.Parse(textBox1.Text)) + "和"+(int.Parse(textBox2.Text)) + "的最大公倍数是:" + Q);
                }
                   
                }
              
            }
        }

           
      

  • 相关阅读:
    hadoop的权限控制
    linux ssh连接超时断连设置
    PuTTY + Xming 远程使用 Linux GUI
    linux系统用户下的crontab任务不执行问题处理
    shell编程注意点
    启动VMware出现报错:The VMware Authorization Service is not running
    mul8_unsigned multipliter
    mul16
    C#基础精华06(Linq To XML,读取xml文件,写入xml)
    C#基础精华05(正则表达式,)
  • 原文地址:https://www.cnblogs.com/a892647300/p/2678853.html
Copyright © 2011-2022 走看看