Professional Documents
Culture Documents
Hint: Recall that according to the Gregorian calendar, a year is a leap year if its number
is a multiple of 4, but not a multiple of 100, and also if it is a multiple of 400.
2. Thechocolate bar has the form of a rectangle divided into n×m slices.
The chocolate bar can be broken once in a straight line into two parts.
Determine whether it is possible to break off a piece of chocolate that
consists of exactly k slices in this way. The program receives three
numbers as input: n, m, k and should output YES or NO.
Option 2.
1. Three integers are given. Find the largest of them (the program should
output exactly one integer).
!!! Use exactly two comparison operators(>, <, >=, <=) to solve this problem. You cannot use
the max and min functions.
2. Letbe given a and b. Solve the equation ax+b=0 in integers. Print all
the solutions to this equation, if their number is finite, print the word
NO, if there are no solutions, print the word INF, if there are infinitely
many solutions.
Option 3.
1. Given three natural numbers a, b, c. Determine whether there is a
triangle with such sides. If the triangle exists, output the string YES,
otherwise output the string NO.
Hint: A triangle is three points that do not lie on the same straight line.
3. Find and output all two-digit numbers that are equal to twice the
product of their digits.
Option 2.
1. Given two integers A and B. Output all the numbers from A to B
inclusive, in ascending order if A < B, or in descending order otherwise.
2. For a given natural n≥2, calculate the sum 1×2+2×3+...+(n-1)×n.
Output the answer as a calculated expression and its values exactly as
shown in the example.
3. The square of a three-digit number ends with three digits equal to that
number. Find and output all such numbers.
Option 3.
1. Given a natural number n. Print all n-digit odd natural numbers in
descending order.
2. Based on the two natural numbers A and B (A≤B), print all the even
numbers on the segment from A to B. You cannot use the if statement in
this task.
3. Given a natural number n. Print in ascending order all three-digit
numbers whose sum of digits is equal to n.
Option 4.
1. For a given non-negative integer n, calculate the value of n!.
2. Several numbers are given. Calculate how many of them are zero, and
output this number.
3. Two four-digit numbers A and B are given. Print in ascending order
all four-digit numbers in the range from A to B, the entry of which
contains exactly three identical digits.