Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
哪位帮我看下哈。。#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator