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 |
代码说明一切#include <iostream> using namespace std; __int64 data[10005]; int main() { data[0]=1; data[1]=1; for(int i=2;i<10005;i++) { data[i]=data[i-1]*i; while(data[i]%10==0) data[i]/=10; data[i]%=100000; //这个数可以取得越大越安全,不过过这一题100000足够 } int n; while(cin>>n) { printf("%5d",n); printf(" -> "); int ans=0; printf("%d\n",data[n]%10); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator