Advertisement
sellmmaahh

OR-postavke2-Filter

Aug 13th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3.  
  4. int Filter (char *s) {
  5.     int br=0;
  6.     while (*s!=0) {
  7.             if (*s>='0' && *s<='9') {
  8.                     br=br*10+(*s-'0');
  9.  
  10.             }
  11.             s++;
  12.     }
  13.     return br;
  14. }
  15. int okreni (int n) {
  16.     int nb=0;
  17.     while (n!=0) {
  18.             nb=nb*10+n%10;
  19.             n/=10;
  20.     }
  21.     return nb;
  22. }
  23. int main () {
  24.     char s[]="hrk45ljus21";
  25.     int rez=Filter(s);
  26.     printf("%d",okreni(rez));
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement