Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:水过250~确实很水,很250~

Posted by qylsw at 2010-07-09 19:18:11 on Problem 1604
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator