Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
不用 %100000 吧?#include <stdio.h> int main() { int i; int n, m, f; while (scanf("%d", &n) != EOF) { f = 1; for (i = 1; i <= n; i++) { m = i; while (m%5 == 0) { f = f%4 ? (f+10)/2 : f/2; m /= 5; } f = (f * m) % 10; } printf("%5d -> %d\n", n, f); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator