Search found 1 match

by abu_raihan
Fri Dec 08, 2017 7:11 pm
Forum: Volume 102 (10200-10299)
Topic: 10212 - The Last Non-zero Digit.
Replies: 63
Views: 30497

Re: 10212 - The Last Non-zero Digit.

Why this is getting WA?? can anyone help??

while (scanf("%lld %lld", &n, &m) == 2)
{
LL s = n-m+1;
LL ans = 1, i;

for(i=s; i<=n; i++)
{
ans *= i;
while(!(ans%10))
ans /= 10;
ans %= 10000000000;
}

printf("%lld\n", ans%10);
}

Go to advanced search