這個題目在台灣都是在整人由 35 開始 算下會 整張 試題都寫不下,這題在104年台南二中也曾經出現過
ANS
90
Function fun (x:integer):integer; Begin If x > 100 then fun = x – 10 Else fun = fun(fun (x+11)) End;
ANS
Now fun(100) = fun(fun(111)) // Since 100 is not > 100.
= fun(101) // since 111 > 100
now this is unlike the other terms which were < 100, so we need to add 11.
Here 101 > 100, thus we again subtract 10 from 101
→ fun = 101-10 = 91
95 ->106
96 ->107`
97 ->108
98 ->109
99 ->110
100->111
101->91
=======
quick ANS
100+11-10=91
99+11-10=90