Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int rekurzija(int broj)
- {
- if (broj == 0)
- return 0;
- int digit = broj % 10;
- if (digit ==7)
- digit = 4;
- return rekurzija(broj/10) * 10 + digit;
- }
- int rekurzija2(int broj)
- {
- if (broj == 7)
- return 4;
- else return rekurzija(broj);
- }
- int main()
- {
- int n;
- printf("Vnesi broj\n");
- scanf("%d",&n);
- printf("%d",rekurzija(n));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment