排球积分

 

程序设计观众界面

 

 

代码如下:

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

转载于:https://www.cnblogs.com/15039000635wyx/p/6194962.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值