My issue
My output is showing wrong but it is right when compared with all the conditions…Please help me I’m unable to move forward
My code
// Update your code below to solve the problem
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
int F=0;
int S=0;
while(t--)
{
int A[10];
for(int i = 0; i < 10; i++)
{
cin >> A[i];
}
for(int i=0; i<5; i++)
{
if(A[i] == 1)
{
F=F+1;
}
}
for(int i=5; i<10; i++)
{
if(A[i] == 1)
{
S=S+1;
}
}
if(F == S)
{
cout<<0<<endl;
}
else if(F > S)
{
cout<<1<<endl;
}
else
{
cout<<2<<endl;
}
}
}
Learning course: C++ for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone