a044: Higher Score 我要九十九
標籤 : Mathematics 數學
通過比率 : 100% (20 人 / 20 人 ) (非即時)
評分方式 :
Tolerant

最近更新 : 2019-04-09 08:53

內容

When you are a student, you should hear about the score adjusting rule of the square root times 10. If the teacher promises to apply this rule, all students will become happy, because you will get 60 if your original score is 36. However, those students whose scores are below 36 still feel stressed. One of these students dreams that the teacher says this adjusting rule can be applied several times until the score reaches to 99. If you are good at mathematics, how many times do you know if we want to adjust a score to be 99? Please write a program to answer this question. The program stops when the input score is -1. Please round off each square root number to the 1st decimal place (e.g., square root(2) = 1.4).

只要當過學生,一定很多人在算分數的時候,聽過老師跟大家說開根號乘以十 。 通常大家這樣都會很開心,因為只要 36 分就可以及格了 ! 但是, 36 分以下的同學就很頭痛了 。 在壓力太大的情況下,有些學生就作夢,夢到老師跟他們說,要讓他們開更號乘以十很多次,可是最後出來的分數要到 99 分才讓他們過 。 數學好的你,可以告訴他們到底最少需要做多少次開根號乘以十,才能夠讓分數等於 99 嗎 ? 當輸入為 -1 時結束程式 。 ( 開根號之後都四捨五入到小數第一位 )

輸入說明

Input several positive integer numbers line-by-line with the last line to be -1. Each integer number N has the limit, 0 < N < 36.

輸入若干筆正整數 N , 0 < N < 36,直到輸入-1時停止。

輸出說明

The number of rounds that are necessary to adjust an input number to be 99. Please print a cartridge return at the end of each output line.

一個正整數 ( 共做了幾次開根號乘以十 ),最後必須有換行字元。

範例輸入
20
35
-1
範例輸出
8
7
測資資訊 :
記憶體限制 : 64 MB
隱藏 測資點#0 (50%): 1.0s , <1K
隱藏 測資點#1 (50%): 1.0s , <1K
提示 :
標籤:
Mathematics 數學
出處:
ITSA_50th [編輯 :
shengZJ (shengZJ)
]


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