zoukankan      html  css  js  c++  java
  • 周记四,看到了

    计划:一星期左右

    开发:

    需求分析:作为一名观众,我希望能够准确了解本场比赛的得分情况

    生成文档:通过画图实现

    具体设计:(看下图)

    具体代码:

    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();
               
            }
            int a = 1;
            int b = 1;
            int i = 1;
            private void btnD1_Click(object sender, EventArgs e)
            {
                int D1 = Convert.ToInt32(txtD1.Text);
                int D2 = Convert.ToInt32(txtD2.Text);
                int DD1 = Convert.ToInt32(txtDD1.Text);
                int DD2 = Convert.ToInt32(txtDD2.Text);
                txtD1.Text = (a++).ToString();
                if (D1 >= 24 && (D1 - D2) > 1)
                {
                    txtDD1.Text = (Convert.ToInt32(txtDD1.Text) + 1).ToString();
                    txtD1.Text = "0";
                    txtD2.Text = "0";
                    txtCount.Text += "第" + (i++) + "局:" + txtDD1.Text + ":" + txtDD2.Text + " ";
                    a = 1;
                    if (txtDD1.Text == "3")
                    {
                        MessageBox.Show("一队胜利");
                        txtD1.Text = "0";
                        txtDD1.Text = "0";
                        txtD2.Text = "0";
                        txtDD2.Text = "0";
                        txtCount.Clear();
                    }
                }
                if (DD1 + DD2 > 3)
                {
                    if (D1 >= 14 && (D1 - D2) > 1)
                    {
                        txtDD1.Text = (Convert.ToInt32(txtDD1.Text) + 1).ToString();
                        txtD1.Text = "0";
                        txtD2.Text = "0";
                        txtCount.Text += "第" + (i++) + "局:" + txtDD1.Text + ":" + txtDD2.Text + " ";
                        a = 1;
                        if (txtDD1.Text == "3")
                        {
                            MessageBox.Show("二队胜利");
                            txtD1.Text = "0";
                            txtDD1.Text = "0";
                            txtD2.Text = "0";
                            txtDD2.Text = "0";
                            txtCount.Clear();
                            i = 1;
                        }
                    }
                }
            }

            private void btnD2_Click(object sender, EventArgs e)
            {
               
                int D1 = Convert.ToInt32(txtD1.Text);
                int D2 = Convert.ToInt32(txtD2.Text);
                int DD1 = Convert.ToInt32(txtDD1.Text);
                int DD2 = Convert.ToInt32(txtDD2.Text);
                txtD2.Text = (b++).ToString();
                if (D2>= 24&&(D2-D1 )>1)
                {
                    txtDD2.Text = (Convert.ToInt32(txtDD2.Text) + 1).ToString();
                    txtD1.Text = "0";
                    txtD2.Text = "0";
                    txtCount.Text += "第" + (i++)+ "局:" + txtDD1.Text + ":" + txtDD2.Text + " ";
                    b= 1;
                    if (txtDD2.Text=="3")
                    {
                        MessageBox.Show("一队胜利");
                        txtD1.Text = "0";
                        txtDD1.Text = "0";
                        txtD2.Text = "0";
                        txtDD2.Text = "0";
                        txtCount.Clear();
                    }
                }
                if(DD1+DD2>3)
                {
                    if (D2 >= 14 && (D2 - D1) > 1)
                    {
                        txtDD2.Text = (Convert.ToInt32(txtDD2.Text) + 1).ToString();
                        txtD1.Text = "0";
                        txtD2.Text = "0";
                        txtCount.Text += "第" + (i++) + "局:" + txtDD1.Text + ":" + txtDD2.Text + " ";
                        b = 1;
                        if (txtDD2.Text == "3")
                        {
                            MessageBox.Show("二队胜利");
                            txtD1.Text = "0";
                            txtDD1.Text = "0";
                            txtD2.Text = "0";
                            txtDD2.Text = "0";
                            txtCount.Clear();
                            i = 1;
                        }
                    }
                }
              
            }

          
         
        }
    }

  • 相关阅读:
    微服务架构技术栈选型手册(万字长文)
    Visual Studio 2013 always switches source control plugin to Git and disconnect TFS
    Visual Studio 2013 always switches source control plugin to Git and disconnect TFS
    MFC对话框中使用CHtmlEditCtrl
    ATL开发 ActiveX控件的 inf文件模板
    ActiveX: 如何用.inf和.ocx文件生成cab文件
    Xslt 1.0中使用Array
    如何分隔两个base64字符串?
    An attempt was made to load a program with an incorrect format
    JQuery 公网 CDN
  • 原文地址:https://www.cnblogs.com/gx-1202B/p/6218500.html
Copyright © 2011-2022 走看看