英文题面:
http://noi.openjudge.cn/ch0405/1249/
翻译:
描述
唯一质因数为 2、3、5 或 7 的数字称为不起眼的数字。序列 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ...显示了前 20 个不起眼的数字。
编写一个程序来查找并打印此序列中的第 n 个元素。
输入
输入由一个或多个测试用例组成。每个测试用例由一个整数 n 组成,其中 1 <= n <= 5842。对于 n,输入由零的值终止。
输出
对于每个测试用例,打印一行,上面写着"第 n 个不起眼的数字是数字"。根据 n 的值,必须使用序数 nth 的正确后缀"st"、"nd"、"rd"或"th",如示例输出中所示。
样例输入
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