# Help me in solving AOCV208 problem

### My issue

i have error in a test case but even the solution part has the same code as min

### 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];
int t1,t2;
for(int i = 0; i < 10; i++)
{
cin >> A[i];
}
t1=A[1]+A[2]+A[3]+A[4]+A[0];
t2=A[5]+A[6]+A[7]+A[8]+A[9];
if(t1>t2)
{
cout<<1<<endl;
}
else if(t1<t2)
{
cout<<2<<endl;
}
else
{
cout<<0<<endl;
}
}
}

``````

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

@shrimathi
u have made logical error t1 stores even index where t2 stores odd index values.
like this.

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

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

``````