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

排球积分

时间:2016-12-18 18:09:34      阅读:355      评论:0      收藏:0      [点我收藏+]

标签:system   ima   san   设计   rgs   style   eve   积分   protect   

 

程序设计观众界面

 

技术分享

 

代码如下:

public partial class 观众 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void A_TextChanged(object sender, EventArgs e)
{
Asheng.Text = A.Text + "胜";
}

protected void B_TextChanged(object sender, EventArgs e)
{
Bsheng.Text = B.Text + "胜";
}

protected void Asheng_Click(object sender, EventArgs e)
{
if (Asheng.Text == null || Asheng.Text == null)
{
Console.Write("请先输入国家:");
}
if (TextBox1.Text == "" && Asheng.Text != "")
{
if (int.Parse(Ayi.Text) < 25)
{
int a = int.Parse(Ayi.Text);
a++;
Ayi.Text = a.ToString();
int c = int.Parse(Byi.Text);
if (a == 25 && a - 1 > c)
{
Console.Write("第一局" + Asheng.Text);
TextBox1.Text = Asheng.Text;
int b = int.Parse(Aying.Text);
b++;
Aying.Text = b.ToString();
}
}
else
{
int a = int.Parse(Ayi.Text);
a++;
Ayi.Text = a.ToString();
int c = int.Parse(Byi.Text);
if (a - 1 > c)
{
Console.Write("第一局" + Asheng.Text);
TextBox1.Text = Asheng.Text;
int b = int.Parse(Aying.Text);
b++;
Aying.Text = b.ToString();
}
}
}
else if (Aer.Text == "" && A.Text != "")
{
if (int.Parse(Ayi.Text) < 25)
{
int a = int.Parse(Ayi.Text);
a++;
Ayi.Text = a.ToString();
int c = int.Parse(Ber.Text);
if (a == 25 && a - 1 > c)
{
Console.Write("第二局" + Asheng.Text);
TextBox2.Text = Asheng.Text;
int b = int.Parse(Aying.Text);
b++;
Aying.Text = b.ToString();

}
}
else
{
int a = int.Parse(Aer.Text);
a++;
Aer.Text = a.ToString();
int c = int.Parse(Ber.Text);
if (a - 1 > c)
{
Console.Write("第二局" + Asheng.Text);
TextBox2.Text = Asheng.Text;
int b = int.Parse(Aying.Text);
b++;
Aying.Text = b.ToString();

}
}
}
else if (TextBox3.Text == "" && A.Text != "")
{

int fen = 25;

if (int.Parse(Asan.Text) < fen)
{
int a = int.Parse(Asan.Text);
a++;
Asan.Text = a.ToString();
int c = int.Parse(Bsan.Text);
if (a == fen && a - 1 > c)
{
Console.Write("第三局" + Asheng.Text);
TextBox3.Text = Asheng.Text;
int b = int.Parse(Aying.Text);
b++;
Aying.Text = b.ToString();
}


}
else
{
int a = int.Parse(Asan.Text);
a++;
Asan.Text = a.ToString();
int c = int.Parse(Bsan.Text);
if (a - 1 > c)
{
Console.Write("第三局" + Asheng.Text);
TextBox3.Text = Asheng.Text;
int b = int.Parse(Aying.Text);
b++;
Aying.Text = b.ToString();
}

}
}
else if (TextBox4.Text == "" && A.Text != "")
{
int fen = 25;
if (int.Parse(Aying.Text) == 3)
{
Console.Write(Asheng.Text);
return;
}
else if (int.Parse(Bying.Text) == 3)
{
Console.Write(Bsheng.Text);
return;
}
else if (int.Parse(Aying.Text) == 2 || int.Parse(Bying.Text) == 2)
{
//决胜场
fen = 25;
}

if (int.Parse(Bsi.Text) <fen)
{
int a = int.Parse(Bsi.Text);
a++;

Bsi.Text = a.ToString();
//如果分数达到25则显示第一局某国家胜
int c = int.Parse(Asi.Text);
if (a == fen && a - 1 > c)
{
Console.Write("第四局" + Bsheng.Text);
TextBox4.Text =Bsheng.Text;
int b = int.Parse(Bying.Text);
b++;
Bying.Text = b.ToString();
}

}
else
{
int a = int.Parse(Bsi.Text);
a++;
Bsi.Text = a.ToString();
int c = int.Parse(Ayi.Text);
if (a - 1 > c)
{
Console.Write("第四局" + Bsheng.Text);
TextBox4.Text =Bsheng.Text;
int b = int.Parse(Bying.Text);
b++;
Bying.Text = b.ToString();
}
}
}
else if (B.Text != "")
{
int fen = 25;
if (int.Parse(Aying.Text) == 3)
{
Console.Write(Asheng.Text);
return;
}
else if (int.Parse(Bying.Text) == 3)
{
Console.Write(Bsheng.Text);
return;
}
else if (int.Parse(Aying.Text) == 2 || int.Parse(Bying.Text) == 2)
{
//决胜场
fen = 15;
}
if (int.Parse(Bwu.Text) < fen )
{
int a = int.Parse(Bwu.Text);
a++;

Bwu.Text = a.ToString();
//如果分数达到25则显示第一局某国家胜
int c = int.Parse(Awu.Text);
if (a == fen && a - 1 > c)
{
Console.Write("第五局" +Bsheng.Text);
TextBox5.Text =Bsheng.Text;
int b = int.Parse(Bying.Text);
b++;
Bying.Text = b.ToString();
}
}
else
{
int a = int.Parse(Bwu.Text);
a++;
Bwu.Text = a.ToString();
int c = int.Parse(Awu.Text);
if (a - 1 > c)
{
Console.Write("第五局" + Bsheng.Text);
TextBox5.Text = Bsheng.Text;
int b = int.Parse(Bying.Text);
b++;
Bying.Text = b.ToString();
}
}

排球积分

标签:system   ima   san   设计   rgs   style   eve   积分   protect   

原文地址:http://www.cnblogs.com/15039000635wyx/p/6194962.html

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