#27439: 解答


yp10952161@yphs.tp.edu.tw (無)

學校 : 臺北市私立延平高級中學
編號 : 146286
來源 : [203.72.178.2]
最後登入時間 :
2023-07-11 11:49:59
c002. 10696 - f91 -- UVa10696 | From: [203.72.178.1] | 發表日期 : 2021-10-05 17:48

#include <iostream>

using namespace std;

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int f91(int n)

{

if(n>=101) return n-10;

else f91(f91(n+11));

}

int main() {

int n;

while(cin>>n, n!=0)

     cout<<"f91(" << n <<") = " << f91(n) <<endl;

 

 

}

 
ZeroJudge Forum