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);
                }
                   
                }
              
            }
        }

           
      

  • 相关阅读:
    Hibernate(九)HQL查询
    Hibernate(八)多对多映射
    Hibernate(七)一对一映射
    Hibernate(六)一对多映射(多对一)
    Hibernate(五)基本数据类型
    Hibernate(四)结构-基础语义和事务
    Hibernate(三)结构-配置文件-实体映射及配置文件
    Hibernate框架简介(二)基本使用增、删、改、查
    Hibernate生成实体类-手工写法(一)
    Java从零开始学四十(反射简述一)
  • 原文地址:https://www.cnblogs.com/a892647300/p/2678853.html
Copyright © 2011-2022 走看看