| ||||||||||
| 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 | |||||||||
Re:水过250~确实很水,很250~In Reply To:水过250~确实很水,很250~ Posted by:Rieman at 2009-11-03 21:36:21 #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
while(cin>>n){
int t=1;
for(int i=1;i<=n;i++){
t*=i;
while(1){
if(t%10!=0) break;
else t/=10;
}
t%=10000;
}
cout<<setw(5)<<n<<" -> "<<t%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