简单题
View Code
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#define maxn 10005
bool is[maxn];
int prm[maxn];
int f[maxn];
int getprm(int n)
{
int i, j, k = 0;
int s, e = (int) (sqrt(0.0 + n) + 1);
memset(is, 1, sizeof(is));
prm[k++] = 2;
is[0] = is[1] = 0;
for (i = 4; i < n; i += 2)
is[i] = 0;
for (i = 3; i < e; i += 2)
if (is[i])
{
prm[k++] = i;
for (s = i * 2, j = i * i; j < n; j += s)
is[j] = 0;
}
for (; i < n; i += 2)
if (is[i])
prm[k++] = i;
return k;
}
int main()
{
//freopen("t.txt", "r", stdin);
int n = getprm(10000);
for (int i = 0; i < 10; i++)
{
int a;
scanf("%d", &a);
for (int j = 0; j < a; j++)
{
while (a % prm[j] == 0)
{
f[j]++;
a /= prm[j];
}
if (a == 1)
break;
}
}
int ans = 1;
for (int i = 0; i < n; i++)
{
ans *= f[i] + 1;
ans %= 10;
}
printf("%d\n", ans);
return 0;
}