Number FactorsProblem code: ENCD02 |
factorizations of a positive integer n is a collection of at least two positive integers, each larger than one, whose product is n. Note that, 2*12 and 12*2 represent the same factorization of 24. In fact, 24 has precisely 6 valid factorizations: 2*2*2*3, 2*2*6, 2*3*4, 2*12, 3*8, and 4*6. so you have to write a program that, given an int n, returns the number of unique factorizations of n.
Input
Input will have number of cases. each case having n. n will be between 2 and 2,000,000,000 inclusive. Terminate the input with n=0.
Output
for each input, output the number of unique factorizations for that number.
Example
Input: 24 9973 9240 1916006400 0 Output: 6 0 295 7389115
| Author: | rscrbv |
| Date Added: | 17-01-2010 |
| Time Limit: | 5 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC |
Comments

Fetching successful submissions

The statement is now visible.
The statement is now visible.
In C
In C language:
-----------------
void main()
{
int a[20],s[20],fact;
}
In C
In C language:
----------------
#include<stdio.h>
#include<conio.h>
void main()
{
int n,count=0,i,r;
clrscr();
printf("Enter the number to which the factors need to be foundn");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
if(n%i==0)
count++;
}
printf("The unique number of factors for the given number is :%dn",count);
}
@lakshmi sravanya Bad Work
@lakshmi sravanya
Bad Work follow etiquettes of the contest
Hint: simple recursion
Hint: simple recursion