damesova

sum

Oct 31st, 2020 (edited)
565
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int A;
  6.     int Sum = 0, Br = 0, Ost = 0;
  7.  
  8.     cout << "Vavedi num A = "; cin >> A;
  9.  
  10.     do {
  11.         Ost = A % 10;
  12.         if(Ost%2 == 0){
  13.         Sum += Ost;
  14.         }
  15.    
  16.         A = A / 10;
  17.  
  18.     } while (A != 0);
  19.  
  20.     cout << "Sumata na cifrite e: " << Sum << '\n';
  21.  
  22.     return 0;
  23. }
RAW Paste Data