Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- int main(int argc, const char * argv[]) {
- int c = 'a';
- int ans = 0;
- while ((c = getchar_unlocked()) != EOF) {
- if (isdigit(c)) {
- ans += c - '0';
- }
- }
- printf("%d\n", ans);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement