题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1492
4 12 0
3 6
代码如下:
#include <cstdio>
#include <cstring>
int main()
{
__int64 n;
__int64 a[4] = {2,3,5,7}, b[4];
while(scanf("%I64d",&n) && n)
{
memset(b,0,sizeof(b));
for(int i = 0; i < 4; i++)
{
while(n%a[i] == 0)
{
b[i]++;
n/=a[i];
}
}
__int64 ans = (b[0]+1)*(b[1]+1)*(b[2]+1)*(b[3]+1);
printf("%I64d\n",ans);
}
return 0;
}HDU 1492 The number of divisors(约数) about Humble Numbers(数学题)
原文地址:http://blog.csdn.net/u012860063/article/details/39296257