如果一個數字它的質因數只有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 2 3 4 11 12 13 21 22 23 100 1000 5842 0
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.
* Luck 貓翻譯
編號 | 身分 | 題目 | 主題 | 人氣 | 發表日期 |
沒有發現任何「解題報告」
|