| ||||||||||
| 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>
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator