Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a, sum = 0;
  8. cin >> a;
  9. for (int i = 1; i <= 13744; i++) {
  10.     if (i % 2 == 0) {
  11.         sum += a%10 ;
  12.     }
  13.     a /= 10;
  14.     if (a == 0) {
  15.         break;
  16.     }
  17. }
  18. cout << sum;
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement