Advertisement
vitormartinotti

f91

May 14th, 2024
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. int f91(int a){
  4.  
  5.     if(a >= 101) return a-10;
  6.  
  7.     return f91(f91(a+11));
  8. }
  9.  
  10. int main() {
  11.  
  12.     while(true){
  13.         int n; scanf("%d", &n);
  14.  
  15.         if(n == 0) break;
  16.  
  17.         printf("f91(%d) = %d\n", n, f91(n));
  18.     }
  19.  
  20.  
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement