您的位置:首页 > 其它

Poj 1401 Factorial

2013-02-27 15:17 453 查看
这是一道水题,不解释来。

#include<stdio.h>
int main()
{
int n,ans;
//freopen("a.txt","r",stdin);
//freopen("b.txt","w",stdout);
scanf("%d",&n);
while(n--)
{
int T;
scanf("%d",&T);

int i,S=1;
ans=0;
while(S<=T)
{
S=5*S;
ans+=T/S;
}
printf("%d\n",ans);
}
//fclose(stdin);
//fclose(stdout);
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  阶乘