Description

Contest

Stack & Queue

Letter

B

About

ARITHMETIC PROGRESSION

B. Аритметична прогресия
---
Да се състави програма, чрез която се въвеждат две естествени числа N от интервала [1000..10000] и M от интервала [100..1000]. N е стойност на последния член на аритметична прогресия, а M е разлика на същата прогресия. Програмата да изчисли и запише в ОПАШКА всички членове на прогресията. Да се изведат елементите на опашката, като първия й член е и първи член на прогресията. От клавиатурата се въвежда първо N и после M.

Примерен вход:
99 10

Примерен изход:
9 19 29 39 49 59 69 79 89 99

B. Arithmetic Progression
---
Compose a program through which two natural numbers are entered N from the interval [1000..10000] and M from the interval [100..1000]. N is the value of the last term of an arithmetic progression, and M is the difference of the same progression. The program calculates and store all members of the progression in QUEUE. Display the elements of the queue, as its first member is also the first member of the progression. Input from the keyboard, first enter N and then M.

Sample input:
99 10

Sample output:
9 19 29 39 49 59 69 79 89 99

Problems Submit