int sc1,sc2,a=0,b=0;
do
{
printf("Give the scores\n");
scanf("%d %d", &sc1,&sc2);
//===============================================
if (sc1 > sc2)
a+=1;
else if (sc1<sc2)
b+=1;
else if (sc1==sc2)
printf("tie\n");
//===============================================
if (a>b)
printf("team 1 is in the lead\n");
else if (a<b)
printf("team 2 is in the lead\n");
else if (b==a)
printf("tie\n");
}
while((a==3) || (b==3));
//===============================================
if (a==3)
printf("team 1 got the cup");
else
printf("team 2 got the cup");
我想我写错了什么。我已经搜索了很多,但似乎找不到它有什么问题。
(两支球队中的一支可以赢得杯赛,那支球队必须有3场胜利)
*否则如果(sc1
*否则如果(a>b)