Arya’s Counting

Little Arya has learnt to count the highest and the lowest number recently. She can easily find out …

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

Why am I getting wrong answer in test case 2???
@touhidur @hjr265

T=int(input())
for i in range(0, T):
    a, b, c=map(int, input().split())
    if a==b or b==c or a==c:
        r="Confused"
    elif(a>b) and (a>c):
        r="A"
    elif (b>a) and (b>c):
        r="B"
    else:
        r="C"
        
    print("Case",str(i+1)+":",r)
if a==b or b==c or a==c:
        r="Confused"

There are more cases of confusion than just this.
Read the problem statement carefully and try again.

why am i getting wrong answer ?

#include<bits/stdc++.h>

using namespace std ;

int main() {
int t ;
cin>> t ;

 for(int i= 1 ;i<=t ;i++) {
    int  max=0 ;
    int a[3] ;
    for(int i=0 ;i<3;i++) {
        cin>> a[i] ;
    }
    int min = a[0] ;
    for(int i =0 ;i<3 ;i++) {
        if(max<a[i]) {max=a[i] ; }
        if(min>a[i]) min = a[i] ;
    }




       if((max==a[0] && max==a[1] && max==a[2] )||( max==a[0] && max==a[1]) ||(max==a[1] && max==a[2]) || (max==a[0] && max==a[2]) )
      cout << "Case " << i <<": " <<"Confused" << endl ;
    else if((min==a[0] && min==a[1] && min==a[2] )||( min==a[0] && min==a[1]) ||(min==a[1] && min==a[2]) || (min==a[0] && min==a[2]) )
      cout << "Case " << i <<": " <<"Confused" << endl ;

    else if(max==a[0]) cout << "Case " << i <<": " <<"A" << endl ;
    else if(max==a[1])  cout << "Case " << i <<": " <<"B" << endl ;
    else if(max==a[2]) cout << "Case " << i <<": " <<"C" << endl ;






 }

return 0 ;
}

#include
using namespace std;
int main()
{
int n , i;
cin >> n;
int a , b , c ;

for( i = 1 ; i <= n ; i++)
{
    cin >> a >> b >> c;

    if( a > b & a > c)
    {
        cout << "Case"<<" "<<i<<':'<<" "<<'A' <<endl ;
    }
    if( b > a & b > c)
    {
        cout << "Case"<<" "<<i<<':'<<" "<<'B' <<endl ;
    }
    if( c > a & c > b)
    {
        cout << "Case"<<" "<<i<<':'<<" "<<'C' <<endl ;
    }
    if( b == a || b == c || a == c)
    {
        cout << "Case"<<" "<<i<<':'<<" "<<"Confused" <<endl ;
    }
}

}

whats problem in this code?