Programming contests

DEIK Regionális Programozó Csapatverseny, középiskolai kategória, 2015. november 29.

November 29, 2015 10:40 AM – November 29, 2015 3:40 PM

Count the Factors!

Write a program that computes the number of different prime factors in a positive integer.

Input Specification

The input tests will consist of a series of positive integers. Each number is on a line on its own. The maximum value is 1 000 000. The end of the input is reached when the number 0 is met. The number 0 should not be considered as part of the test set.

Output Specification

The program should output each result on a line by its own, following the format given in the sample output.

Sample Input

  1. 289384
  2. 930887
  3. 692778
  4. 636916
  5. 747794
  6. 238336
  7. 885387
  8. 760493
  9. 516650
  10. 641422
  11. 0
download as text file

Output for Sample Input

  1. 289384 : 3
  2. 930887 : 2
  3. 692778 : 5
  4. 636916 : 4
  5. 747794 : 3
  6. 238336 : 3
  7. 885387 : 2
  8. 760493 : 2
  9. 516650 : 3
  10. 641422 : 3
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019