ACM (UVa) : 10699


#include
#include

int main ()
{
int number;

while ( scanf (“%d”, &number) != EOF ) {

if ( number == 0 )
return 0;
int save = number;

int count = 0;

if ( floor ( sqrt (number) ) == sqrt (number) )
count–;

int i;
for ( i = 2; i <= sqrt (number) + 1; i++ ) { int flag = 0; while ( number % i == 0 ) { number /= i; flag = 1; } if ( flag == 1 ) count++; } printf("%d : %d\n", save, count+1); } return 0; } [/sourcecode]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s