vector queastion

I don t know how to find the element which has the biggest number of divisors from the n elements .can u help me with an algoritm,please?

example:
vect.in
5
11 3 13 9 19
vect.out
9(9 has the biggest number of divisors)



Last edited on
Write a function (say:
1
2
int numberOfDivisors( int n )
{ // your function } 

which will take an integer n and return how many divisors it has. Test this function first.

Write a routine to read vect.in into a vector. Test this routine.

Write a main() program that will send each element of the vector that you created in the previous paragraph to your numberOfDivisors function and keep a running tab of the biggest.


Last edited on
Topic archived. No new replies allowed.