Help me in solving AOCV208 problem

My issue

My code

// Update your code below to solve the problem


#include <bits/stdc++.h>
using namespace std;

int main() 
{
	int t;
    cin >> t;
	
	while(t--)
	{
	    int A[10];
	    for(int i = 0; i < 10; i++)
	    {
	        cin >> A[i];
	    }
	    
	    int team1 = A[1] + A[3] + A[5] + A[7] + A[9];
	    int team2 = A[2] + A[4] + A[6] + A[8] + A[10];
	    
	    if (team1>team2)
	    {
	        cout<<"1"<<endl;
	    }
	    
	    else if (team1<team2)
	    {
	        cout<<"2"<<endl;
	    }
	    
	    else
	    {
	        cout<<"0"<<endl;
	    }
    }
}


Learning course: C++ for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone

indexing starts from 0 in array

1 Like