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:纪念

Posted by jongsuny at 2008-04-30 18:02:25 on Problem 1604
In Reply To:纪念 Posted by:Cathy11 at 2008-04-04 01:36:47
> 在此纪念,俺100啦~~三位数
俺也是第100个水题了,,哈哈 奖励大家,,虽然不是高效的算法,但是能AC..嘿嘿
以后开始要做点算法题了
#include <iostream>
#include <iomanip>
#include <cmath>
#include <fstream>
using namespace std;
int main()
{
	int n,a[10001]={1},t=1;
	for(int i=1;i<=10000;i++)
	{
		t=t*i;
		while(!(t%10)||(t>100000))
		{
			if(t%10==0)
				t/=10;
			t=t%100000;
		}
		a[i]=t%10;
	}
	while(cin>>n)
	{
		cout<<setw(5)<<n<<" -> "<<a[n]<<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