TOPIC

what is the problem? it shows 20% wrong answer

Mahadi Karim Munif asked 2 months ago

include

using namespace std;

int main() { long double a,b,c,d; cin>>a>>b>>c>>d; if(a+b==c+d){ cout<<"YES"<<endl; } else if(a+c==d+b){ cout<<"YES"<<endl; } else if(a+d==b+c){ cout<<"YES"<<endl; } else if(a==b+c+d){ cout<<"YES"<<endl; } else if(b==c+d+a){ cout<<"YES"<<endl; } else if(c==a+b+d){ cout<<"YES"<<endl; } else if(d==a+b+c){ cout<<"YES"<<endl; } else{ cout<<"NO"<<endl; } }

Remember not post solutions. Your post may be reviewed by our moderators.

  • Esrael Sousa (IFCE - TIANGUA) replied 2 months ago

    Perhaps it is a precision error. Attempts to read the decimal part as an integer.

    using Google translator