Matrix snake


Submit solution

Points: 20
Time limit: 2.0s
Memory limit: 64M

Authors:
Problem type

題目說明

<1124檢定考題>

請設計Java程式由鍵盤輸入一個 正整數 n,
將 n 加上一個最小正整數 x 後可以得到一個立方數,此立方數為 (n+x)。

提示:可利用Math.cbrt 函數來計算

輸入

由鍵盤輸入一個 正整數 n

輸出

將 n 加上一個最小正整數 x 後可以得到一個立方數,此立方數為 (n+x)。
由螢幕輸出 x , (n+x), (n+x)的立方根

sample input1

20

sample output1

7 27 3

說明:輸出的第一個數字7為正整數x,第二個數字27為立方數,第三個數字3為27的立方根。

sample input2

64

sample output2

61 125 5

說明:輸出的第一個數字61為正整數x,第二個數字125為立方數,第三個數字5為125的立方根。

sample input3

7

sample output3

1 8 2

說明:輸出的第一個數字1為正整數x,第二個數字8為立方數,第三個數字2為8的立方根。


Comments

There are no comments at the moment.