Advertisement
BorjanCrvenkov

Code rekurzija 1 C

Feb 5th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int funkcija(int broj,int max) {
  4. if(broj==0) {
  5. printf("%d\n",max);
  6. } else {
  7. if(broj%10>max) {
  8. max=broj%10;
  9. }
  10. return funkcija(broj/10,max);
  11. }
  12.  
  13.  
  14. }
  15.  
  16.  
  17. int main() {
  18. int broj;
  19. while(scanf("%d",&broj)) {
  20. funkcija(broj,0);
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement