Programmer's Written Exam: Daying Cloud 2021 Technical Programming Questions Collection (12)

1. Read in a natural number N, find the Nth ugly number in ascending order and output it. Note: The number that only contains factors 2, 3 and 5 is called Ugly Number. For example, 6 and 8 are both ugly numbers, but 14 is not because it contains a factor of 7. Traditionally, we treat 1 as the first ugly number.
Input description: The
input includes an integer N (1<=N<=1500).
Output description:
Each time a test data is input, the Nth ugly number is output.
Example input:
3
Example output:
3

2. Suppose a, b, c, and d are all numbers between 0 and 9, and abcd and bcda are two four-digit numbers, and there are: abcd+bcda=8888. Find all a, b, c that meet the conditions, The value of d.
Output according to the order of a from small to large.
Input description:
There is no input for this question.
Output description:
Please output all values ​​of a, b, c, and d that meet the conditions of the question.
A, b, c, and d are separated by spaces, and
each output occupies one line

3. Given a list of integers, the value selected in the list any number of such selected and the maximum value, the required value in the original selection list can not be adjacent to
enter a description of:
a list of integers, separated by commas
output Description:
The value of the maximum sum
Example input:
1,2,3,4,5
Example output:
9

Guess you like

Origin blog.csdn.net/qq_34124009/article/details/108573048