#include <iostream>
#include <fstream>
using namespace std;
signed main() {
try {
ifstream f;
int _sum = 0, n, x;
f.open("name.txt");
f >> n;
while (!f.eof()) {
int i = 0;
f >> x;
_sum += x;
i++;
}
if (_sum % 2 == 0)
cout << "YES";
else
cout << "NO";
catch (...) {
cout << "Error!";
return 0;
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
#include <fstream>
using namespace std;
signed main() {
try {
ifstream f;
int _sum = 0, n, x;
f.open("name.txt");
f >> n;
while (!f.eof()) {
int i = 0;
f >> x;
_sum += x;
i++;
}
if (_sum % 2 == 0)
cout << "YES";
else
cout << "NO";
}
catch (...) {
cout << "Error!";
}
return 0;
}