标签:
1 #include <cstdio> 2 #define ll long long 3 4 const ll MOD = 1e9; 5 6 int main() 7 { 8 ll N, M; 9 while(scanf("%lld%lld", &N, &M) != EOF) 10 { 11 ll ans = 1; 12 while(M--) 13 { 14 ans *= N--; 15 while(! (ans % 10)) ans /= 10; 16 ans %= MOD; 17 } 18 printf("%lld\n", ans % 10); 19 } 20 return 0; 21 }
uva 10212 - The Last Non-zero Digit.
标签:
原文地址:http://www.cnblogs.com/aze-003/p/5149266.html