-
Your friend, Jackson is invited to a TV show called SuperMemo in
which the participant is told to play a memorizing game. At first,
the host tells the participant a sequence of numbers, {A
1, A
2, ... An
}. Then the host performs a series of operations and queries on
the sequence which consists:
ADD x y D: Add D to each number in sub-sequence {Ax
... Ay
}. For example, performing "ADD 2 4 1" on {1,
2, 3, 4, 5} results in {1, 3, 4, 5, 5}
REVERSE x y: reverse the sub-sequ ...
阅读题目
问答题
经典指数
-
-
-
-
-
-
-
-
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 ...
阅读题目
问答题
经典指数
-