// Run time: 0.010
#include <stdio.h>
int main()
{
int n;
int i;
long long int prod;
while (scanf("%d", &n) != EOF)
{
prod = 1;
for ( i = 2; i <= n; i++)
{
prod *= i;
while (!(prod%10)) prod /= 10;
prod %= 100000;
}
printf("%5d -> %lld\n", n, prod%10);
}
return 0;
}
沒有留言:
張貼留言