#include <cstdio>
#include <cmath>
using namespace std;
const int MAXN = 10002;
int a[MAXN];
void pre()
{
int s = 1;
for(int i=1; i<MAXN; i++) {
int t = i;
while(t%10 == 0) {
t /= 10;
}
s *= t;
while(s%10 == 0) {
s /= 10;
}
a[i] = s%10;
s %= 100000;
}
}
int main() {
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif
int n;
a[0] = 1;
pre();
while(scanf("%d", &n) == 1) {
printf("%5d -> %d\n", n, a[n]);
}
return 0;
}
UVa 568 Just the Facts
最新推荐文章于 2017-09-06 09:21:52 发布