#22870: 一直OLE怎麼解?


wayne71112 (悠人)

學校 : 大同大學
編號 : 127348
來源 : [123.51.254.186]
最後登入時間 :
2024-02-21 10:34:53
c002. 10696 - f91 -- UVa10696 | From: [114.37.176.229] | 發表日期 : 2020-10-08 12:49

#include <iostream>
#include <math.h>
 
using namespace std;
 
int f91 (int in0 ){
    if (in0 <=100 ){
       return  f91(f91(in0 +11 ) ) ;
    }
    else{
         return in0 -10 ;
    }
}
int main(){
    int n;
    while(cin>>n){
    cout<<"f91""("<<n<<")"" = ";
    n=(n<101)?91:n-10;
    cout<<n<<endl;
    }
    return 0;
}
 
 
ZeroJudge Forum