The number of divisors (approximate) about Humble Numbers
Time limit:2000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 3033 Accepted Submission (s): 1465
Problem Descriptiona number whose only prime factors be 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, ten,, +, (+), A, ten, A, ten, ten, ... shows the first humble numbers.
Now given a humble number, please write a program to calculate the number of divisors about this humble number. For Examle, 4 is a humble,and it has 3 divisors (1,2,4) and 6 divisors.
Inputthe input consists of multiple test cases. Each test case consists of one humble number N,and n was in the range of 64-bits signed integer. Input is terminated by a value of zero for N.
Outputfor Each test case, the output its divisor number, the one line per case.
Sample Input4120
Sample Output36
1#include <cstdio>2#include <iostream>3 using namespacestd;4 intMain ()5 {6 Long LongN;7 while(cin>>n&&N)8 {9 Long Longa[4]={1,1,1,1};Ten intb[4]={2,3,5,7},i; One for(i=0;i<4; i++) A { - while(n%b[i]==0) - { thea[i]++; -n=n/B[i]; - } - } +cout<<a[0]*a[1]*a[2]*a[3]<<Endl; - } +}
The number of divisors (approximate) about Humble Numbers