ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Форумы > Обсуждение задач > тема:


Задача "Prime Factorization"

Идёт турнир!

В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания.

imesecan06.мая.2011 в 16:35:15
0Сообщение скрыто

imesecan07.мая.2011 в 22:26:36
1While the number is greater then 1 we continue:
we start a divisor from 2. While the number is divisible by 2 we divide it and show two on the screen.
When it is not divisible by 2, we increment it to 3. and we continue dividing by three, if it's divisible.

if the number is a prime number (like 11), no numbers will divide it and the divisor will always be incremented until the number itself. When the divisor is equal to the number it will be divided. Then, the result will be one and the program will quit.


www.contester.ru