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