fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. char c;
  6. int sum = 0;
  7. while(cin >> c)
  8. if((c - '0') % 2 == 0)
  9. sum += (c - '0');
  10. cout << sum << '\n';
  11. return 0;
  12. }
Success #stdin #stdout 0s 15232KB
stdin
888888888888888888888888888888
stdout
240