Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int SumaCifara (char *s)
- {
- int suma=0;
- while (*s!=0) {
- if (*s>='0' && *s<='9' ) suma+=*s-'0';
- s++;
- }
- return suma;
- }
- int main () {
- char s[]="hrk12ljus34";
- printf("%d",SumaCifara(s));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement