Learning course: C for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone
Feedback
// Update your code below to solve the problem
#include <stdio.h>
int main()
{
int t;
scanf("%d", &t);
int team1=0;
int team2=0;
while(t--)
{
int A[10];
for(int i = 0; i < 10; i++)
{
scanf("%d", &A[i]);
if(i%2==0)
{
if(A[i]==1)
team1++;
}
else
{
if(A[i]==1)
team2++;
}
}
if(team1>team2)
printf("1\n");
else if(team1<team2)
printf("2\n");
else
printf("0\n");
}
return 0;
}
what’s wrong in this code?