c122. 00443 - Humble Numbers
標籤 :
通過比率 : 520人/589人 ( 88% ) [非即時]
評分方式:
Strictly

最近更新 : 2015-08-28 15:13

內容

如果一個數字它的質因數只有2,3,5或7則我們稱這個數字為Humble number。下列數字代表前20個Humble numbers:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27,...

輸入說明

輸入包含多個測試資料。每一個測試資料包含一個整數n,1<= n <= 5842。當n=0時代表輸入結束。

輸出說明

對每個測試資料必須輸出一行"The nth humble number is number."。對每個nth你必須依照n值不同輸出正確的序數"st", "nd", "rd", 或"th"。請參考sample output。

範例輸入 #1
1
2
3
4
11
12
13
21
22
23
100
1000
5842
0
範例輸出 #1
The 1st humble number is 1.
The 2nd humble number is 2.
The 3rd humble number is 3.
The 4th humble number is 4.
The 11th humble number is 12.
The 12th humble number is 14.
The 13th humble number is 15.
The 21st humble number is 28.
The 22nd humble number is 30.
The 23rd humble number is 32.
The 100th humble number is 450.
The 1000th humble number is 385875.
The 5842nd humble number is 2000000000.
測資資訊:
記憶體限制: 512 MB
公開 測資點#0 (100%): 1.0s , <1M
提示 :

* Luck 貓翻譯

標籤:
出處:
UVa443

本題狀況 本題討論 排行

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