why does this show wrong answer

#include
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
	    int a, b, c;
	    cin>>a>>b>>c;
	    if((a+b+c==180)&&(a>=40&& b>=40 &&c>=40))
	    cout<<"\nYES";
	    else
	    cout<<"\nNO";
	    
	}
	return 0;
}

why you are printing \n first… This will generate empty line first… Not sure if this is an issue here… But you can try after correcting it…

&&(a>=40&& b>=40 &&c>=40)

Remove this check. I dont think this is needed. Check if removing this helps.