-
-
-
-
-
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The
sequence
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, ...
shows the first 10 ugly numbers. By convention, 1 is included.
Given the integer n,write a program to find and print the n'th ugly
number.
输入描述
Each line of the input contains a postisive intege输出描述
For each line, output the n’th ugly number .:Don’t deal with the line
with n=0.输入例子
1
2
9
0
输出例子
1
2
10 ...
阅读题目
问答题
经典指数
-
-
Farmer John has received a noise complaint from his neighbor, Farmer
Bob, stating that his cows are making too much noise.
FJ's N c输入描述
* Line 1: N
* Lines 2..N+1: The location of each cow (in the range 0..1,000,000,000).输出描述
There are five cows at locations 1, 5, 3, 2, and 4.输入例子
5
1
5
3
2
4
输出例子
40
Hint
INPUT DETAILS:
There are five cows at locations 1, 5, 3, 2, and 4.
OUTPUT DETAILS:
Cow at 1 contributes 1+2+3+4=10, cow at 5 contributes 4+3+2+1=10,
cow at 3 contributes 2+1+1+2=6, cow ...
阅读题目
问答题
经典指数
-
-
-