Advertisement
fahimkamal63

f91

Jun 21st, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. //  G - Guess the function, you geek!
  2. //  Date : 11.05.19
  3. #include<iostream>
  4. #include<cstdio>
  5. using namespace std;
  6.  
  7. int f91(int n){
  8.     if(n >= 101) return n-10;
  9.     else if(n <= 100){
  10.         f91(f91(n+11));
  11.         //f91(n+10);
  12.     }
  13. }
  14.  
  15. int main(){
  16.     int n;
  17.     while(scanf("%d", &n) == 1 && n != 0){
  18.         if(n <= 101)printf("f91(%d) = %d\n", n,91);
  19.         else printf("f91(%d) = %d\n", n,n-10);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement