fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int a,b,c;
  7. long long d;
  8.  
  9. cin >> a >> b >> c >> d;
  10.  
  11. if(a+b-c==d)
  12. {
  13. cout <<"Yes";
  14. }
  15. else if(a-b+c==d)
  16. {
  17. cout <<"Yes";
  18. }
  19. else if(a+b*c==d)
  20. {
  21. cout <<"Yes";
  22. }
  23. else if(a*b+c==d)
  24. {
  25. cout <<"Yes";
  26. }
  27. else if(a-b*c==d)
  28. {
  29. cout <<"Yes";
  30. }
  31. else if(a*b-c==d)
  32. {
  33. cout <<"Yes";
  34. }
  35. else {
  36. cout <<"No";
  37. }
  38.  
  39. return 0;
  40. }
  41.  
  42.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
No