UVA568 (暑假-数论 -C - Just the Facts)

来源:互联网 发布:淘宝网法院拍卖 编辑:程序博客网 时间:2024/06/10 07:47
#include <cstdio>int main() {int n;while (scanf("%d",&n) != EOF) {int sum = 1;for (int i = 1; i <= n; i++) {sum *= i; while (sum % 10 == 0) {sum /= 10;}sum %= 100000;}printf("%5d -> %d\n", n, sum % 10);}return 0;}

0 0
原创粉丝点击