Created
June 7, 2019 13:05
-
-
Save Thiago4532/0ee6aac21f28966ff5bb58d2975ea79e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment