Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <inttypes.h>
- #include <ctype.h>
- int main()
- {
- char c;
- int64_t sum = 0;
- while (scanf("%c", &c) == 1)
- {
- if (isdigit(c))
- {
- int a = (int)c - 48;
- sum += a;
- }
- }
- printf("%ld" "\n", sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement