Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int f(char* str);
- int main()
- {
- int a = f("aaaas hhhh 757843 4585 hhjknfh");
- printf("%d/n", a);
- return 0;
- }
- int f(char* str)
- {
- int count = 0;
- int ln = 0;
- while (*str != '\0')
- {
- if(*str>='0' && *str<='9')
- {
- if(ln == 0)
- {
- count++;
- }
- ln=1;
- }
- else
- {
- ln=0;
- }
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement