Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n, a, b, c, d;
- int resp = 0;
- cin >> n >> a >> b >> c >> d;
- int S = a+b+c+d;
- if(n == a) resp++;
- if(n == b) resp++;
- if(n == c) resp++;
- if(n == d) resp++;
- if(n == a+b) resp++;
- if(n == a+c) resp++;
- if(n == a+d) resp++;
- if(n == b+c) resp++;
- if(n == c+d) resp++;
- if(n == d+a) resp++;
- if(n == S-a) resp++;
- if(n == S-b) resp++;
- if(n == S-c) resp++;
- if(n == S-d) resp++;
- if(n == S) resp++;
- cout << resp << "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement