Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. int n, a, b, c, d;
  8. int resp = 0;
  9.  
  10. cin >> n >> a >> b >> c >> d;
  11.  
  12. int S = a+b+c+d;
  13.  
  14. if(n == a) resp++;
  15.  
  16. if(n == b) resp++;
  17.  
  18. if(n == c) resp++;
  19.  
  20. if(n == d) resp++;
  21.  
  22. if(n == a+b) resp++;
  23.  
  24. if(n == a+c) resp++;
  25.  
  26. if(n == a+d) resp++;
  27.  
  28. if(n == b+c) resp++;
  29.  
  30. if(n == c+d) resp++;
  31.  
  32. if(n == d+a) resp++;
  33.  
  34. if(n == S-a) resp++;
  35.  
  36. if(n == S-b) resp++;
  37.  
  38. if(n == S-c) resp++;
  39.  
  40. if(n == S-d) resp++;
  41.  
  42. if(n == S) resp++;
  43.  
  44. cout << resp << "\n";
  45.  
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement