1. 
/**
 * Angewandte Mathematik, SS09, IFB 2C
 * ACM Problem #10699 (Problem D - Count the factors)
 *
Link:
http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=18&page=show_problem&problem=1640
 *
 * @author Mohr
 * @author Schirm
 * @author Mathauser
 * @version 1.0, 03/30/2009
 *
 * Status : Accepted
 * Runtime: 0.060
 */

 
import java.io.BufferedReader;
import java.io.InputStreamReader;
 
public class Main {
 
 
    public static boolean isPrim(int n) {
 
        if(n == 1 || n%2 == 0)
            return false;
 
        short root = (short)Math.sqrt(n);
        for (int i = 3; i <= root; i=i+2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }
 
 
    public static void main(String...args) throws Exception{
 
        BufferedReader reader = new BufferedReader(new
        InputStreamReader(System.in));
       
    //    int buf = zahl;
        int[] prime = new int[168];
        prime[0]=2;
        int anz=1;
       
        for(int i = 3; i<=1000; i+=2) {
            if(isPrim(i)) {
                prime[anz]=i;
                anz+=1;
            }
        }
       
        while(true)    {
            int zahl = Integer.parseInt(reader.readLine());
            if(zahl == 0)
                break;
            int buf = zahl;
           
            int count=0;
            for(int i = 0; i < prime.length; i++){
                if(buf%prime[i] == 0)   
                    count++;
                while(buf%prime[i] == 0)    {
                    //System.out.println(zahl + " " + buf + "/" + prime[i]);
                    buf/=prime[i];
                }
            }
                if(buf != 1)
                    count++;
               
                System.out.println(zahl + " : " + count);
               
        }
       
       
           
    }
}



2.
/**
* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #10699 (Count the factors)
* Link: http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=18&page=show_problem&problem=1640
*
* @author Christian Posselt
* @author Jonathan Schubert
* @version 1.0, 03/30/2009
*
* Status : Accepted
* Runtime: 0.210
*/

import java.util.Scanner;

class Main {

/**
* ctf - Count the factors
*
* @param n: Int value which the number to deal with
* @return Integer representing the number of prime factors;
*/
public static int ctf(int n) {

int count = 1;

//check if "2" is a factor.
if(n%2==0)
{
count++;
while(n%2==0)
n = n/2;
}

//find all primes and count them
for(int j=3; j*j<=n;j+=2)
if(n%j==0)
{
count++;
while(n%j==0)
n = n/j;
}

return count;
}


public static void main(String[] args) {

//setting up all needed variables
Scanner sc = new Scanner(System.in);
int factors, number;

while(sc.hasNext())
{
//Read-in of a number
number = Math.abs(sc.nextInt());

if(number==0)
break;

//count factors
factors = ctf(number);

//SystemOut
System.out.println(number + " : " +factors);

}
}

}





3.


/**
* Angewandte Mathematik SS 09
10699 Count the Factors
* UVa Status: Accepted
* Run Time: 0.000
* Programming Language: C
* Date: 26.03.2009
* @author Doina Logofatu logofatu@hm.edu
*/


#include <stdio.h>
#include <math.h>

int ctf(long long n){

long long j;
int p = 0;

if(n%2==0) {p++; while(n%2==0) n/=2;}

for(j=3; n!=1 && j*j<=n; j+=2){
if(n%j==0){
p++;
while(n%j==0) n/=j;
}
}

if(n>1) p++;

return p;

}

int main() {

long long n;

while(scanf("%lld", &n)==1 && n!=0) {

if(n<0)n*=-1;
printf ("%lld : %d\n", n, ctf(n));

}
return 0;
}