Skip to content

Instantly share code, notes, and snippets.

@Thiago4532
Created June 7, 2019 13:05
Show Gist options
  • Save Thiago4532/0ee6aac21f28966ff5bb58d2975ea79e to your computer and use it in GitHub Desktop.
Save Thiago4532/0ee6aac21f28966ff5bb58d2975ea79e to your computer and use it in GitHub Desktop.
#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