SHARE
TWEET

Untitled

a guest Dec 9th, 2019 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <inttypes.h>
  3. #include <ctype.h>
  4.  
  5. int main()
  6. {
  7.     char c;
  8.     int64_t sum = 0;
  9.     while (scanf("%c", &c) == 1)
  10.     {
  11.         if (isdigit(c))
  12.         {
  13.             int a = (int)c - 48;
  14.             sum += a;
  15.         }
  16.     }
  17.     printf("%ld" "\n", sum);
  18.    
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top