Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- using namespace std;
- int main(){
- int x;
- while (cin >> x){
- vector<int> v(x);
- int s;
- for (int i = 0; i < x; ++i) cin >> s;
- bool trobat = false;
- if (x == 0){
- trobat = true;
- cout << "NO" << endl;
- }
- for (int i = 0; i < x && !trobat; ++i){
- int suma = 0;
- for (int j = 0; j < x; ++j){
- if (j != i) suma += v[j];
- }
- if (v[i] == suma){
- trobat = true;
- cout << "SI" << endl;
- }
- }
- if (!trobat) cout << "NO" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement