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

没有理由啊!这样也能过哈!

Posted by zhangliqiang at 2007-09-13 13:21:33 on Problem 1604
#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:
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