Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void rekurzija(int n) {
- if(n == 0) {
- return;
- }
- int cifra = n % 10;
- rekurzija(n / 10);
- printf("%c", 'A' + cifra);
- }
- int main (int argc, const char * argv[]) {
- int n;
- scanf("%d", &n);
- rekurzija(n);
- return 0;
- }
- // rekurzija(5608) = rekurzija(560) | print(F)
- // rekurzija(560) = rekurzija(56) | print(G)
- // rekurzija(56) = rekurzija(5) | print(A)
- // rekurzija(5) = rekurzija(0) | print(I)
- // rekurzija(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement