Advertisement
xerpi

Problem P37297: Control C101A

Oct 13th, 2013
801
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. /*
  2. * Copyright (C) 2013, xerpi
  3. */
  4.  
  5.  
  6. #include <iostream>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     int n;
  12.     cin >> n;
  13.     int suma = 0;
  14.     for (int i = 0; i < 3; ++i) {
  15.         suma += n%10;
  16.         n /= 10;
  17.     }
  18.     cout << suma << endl;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement