Untitled

Anonymous
c_cpp
10/19/2023 4:46 PM
356 B
18
Indexable
#include <iostream>
#include <cmath>
using namespace std;

int main() {

    int a,sum = 0;

    cin >> a;

    while (a != 0) {
        if ((a % 10) % 2 == 0) {
            sum += 1;
        }
        a /= 10;
    }
    cout << sum;
    return 0;
}
Editor is loading...