StoneHaos

358

Nov 2nd, 2019
128
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //358
  2. #include <iostream>
  3. #include <cstdio>
  4. using namespace std;
  5.  
  6. int main(void) {
  7.     freopen("input.txt", "r", stdin);
  8.     freopen("output.txt", "w", stdout);
  9.  
  10.     int n, sum = 0;
  11.     cin >> n;
  12.     sum += n % 10;
  13.     n /= 10;
  14.     sum += n % 10;
  15.     sum += n / 10;
  16.     cout << sum << "\n";
  17.     return 0;
  18. }
RAW Paste Data