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 windyrobin at 2008-08-20 10:12:43 on Problem 1401
#include <stdio.h>

void calZeros(int n)
{
	int sum = 0 ;
	for(int i=5 ;i<=n ;i*=5){
		sum += n/i;
	}
	printf("%d\n" ,sum);
}

int main()
{
	freopen("1401.txt" ,"r" ,stdin);
	int n;
	int testCase;
	scanf("%d" ,&testCase);
	while (testCase-- > 0){
		scanf("%d" ,&n);
		calZeros(n);
	}
	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