a086: Recursive program exercise 遞迴程式練習
標籤 :
通過比率 : 100% (3 人 / 3 人 ) (非即時)
評分方式 :
Tolerant

最近更新 : 2021-04-13 16:17

內容

Problem Description:

Given the following recursive function:

The floor function is the function that takes as input a real number X , and gives as output the greatest integer less than or equal to X  denoted floor(X) or ⌊X⌋. 

 

Floor example

x

Floor

2

2

2.4

2

2.9

2

-2.7

-3

-2

-2

 

問題描述:

給定下列遞迴函式 :

 

取整函數是一類將實數對映到相近的整數的函數。常用的取整函數有兩個,分別是下取整函數和上取整函數。

下取整函數即為取底符號,在數學中一般記作⌊⌋或 在電腦科學中一般記作floor(x),表示不超過x的整數中最大的一個。

Floor 範例

x

Floor

2

2

2.4

2

2.9

2

-2.7

-3

-2

-2

 

 

Please calculate f (k).

請計算出 (k) 。 

 

輸入說明

Input:

The input value is an integer greater than 1.

輸入說明:

輸入值為一個大於 1 的整數。

 

輸出說明

Output description:

The calculation result of f(k).

輸出說明:

f(k) 的計算結果。

範例輸入
10
12
範例輸出
60
94
測資資訊 :
記憶體限制 : 64 MB
隱藏 測資點#0 (33%): 1.0s , <1K
隱藏 測資點#1 (33%): 1.0s , <1K
隱藏 測資點#2 (34%): 1.0s , <1K
提示 :
標籤:
出處:
[編輯 :
shengZJ (shengZJ)
]


編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」