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.h> #include<iomanip.h> int main() { int n,i; while(cin>>n) { int m=1; for(i=1;i<=n;i++) { m=m*i; if(m%10==0) while(m%10==0) m=m/10; m=m%100000; } cout<<setw(5)<<n<<" -> "<<m%10<<endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator