Can anybody explain my mistake? Problem code- CHFSPL

Hi I’m facing issue in the problem CHFSPL. Can someone help me…

Here’s the code-

#include
using namespace std;

int main() {
// your code goes here
int t;
cin>>t;
while(t>0)
{
int a,b,c;
cin>>a>>b>>c;
if(((a+b)>(b+c))&&((a+b)>(a+c)))
cout<<(a+b)<<endl;
else if(((b+c)>(a+b))&&((b+c)>(a+c)))
cout<<(b+c)<<endl;
else
cout<<(a+c)<<endl;
t–;
}
return 0;
}

Consider the case when a, b, and c are not distinct.
In particular, you might try the following test input:

3
1 1 2
1 2 1
2 1 1

The output should be the same for all three three test cases, but you will see that they are not.