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 christbob at 2007-09-25 15:29:48 on Problem 1401
#include <stdio.h>
#include <math.h>
long func(long x)
{
	int i;
	long y,sum;
	sum = 0;
	y = (long)(log10(x)/log10(5));
	for(i=1;i <= y;i++)
	{
		sum += x/(long)(pow(5,i));
	}
	return sum;

}
main()
{
	int T;
	long n;
	scanf("%d",&T);
	while(T--)
	{
		scanf("%ld",&n);
		printf("%ld\n",func(n));
	}
}
测试数据都是对的,搞不懂为什么就WA了

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