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");
私は何か間違ったことを書いたと思います。私はそれをたくさん検索しましたが、何が問題なのかを見つけることができないようです。
(2チームのうち1チームがカップを獲得でき、そのチームは3勝する必要があります)
*else if(sc1
*else if(a>b)