帮我看看哪里错了? 4 right wrong give-up right right right wrong right right right right
#include<stdio.h>#include<string.h>
struct Team {
int no;
int score;
};
int main()
{
struct Team team[3],temp;
int i,j,n;
char answer[10];
for(i=0;i<3;i++)
{
team[i].no=i+1;
team[i].score=0;
}
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=0;j<3;j++)
{
scanf("%s",answer);
if(strcmp(answer,"right")==0)
team[j].score+=10;
if(strcmp(answer,"wrong")==0)
team[j].score-=10;
if(strcmp(answer,"give-up")==0)
team[j].score=team[j].score;
}
}
for(i=0;i<2;i++)
{
for(j=i+1;j<3;j++)
{
if(team[i].score<team[j].score)
temp=team[i];
team[i]=team[j];
team[j]=temp;
}
}
for(i=0;i<3;i++)
{
printf("(%d,%d)\n",team[i].no,team[i].score);
}
return 0;
}