Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- const int MAX_SIZE = 99;
- int numbers[MAX_SIZE]{};
- int arrSize, sumEven = 0;
- cin >> arrSize;
- for (int i = 0; i < arrSize; i++) {
- cin >> numbers[i];
- }
- for (int i = 0; i < arrSize; i++) {
- if (numbers[i] % 2 == 0) {
- sumEven += numbers[i];
- }
- }
- cout << sumEven << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement