| 记录编号 | 89921 | 评测结果 | AAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1074.[POJ1401] 阶乘末尾的0 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.728 s | ||
| 提交时间 | 2014-03-04 19:39:45 | 内存使用 | 0.31 MiB | ||
#include<fstream>
using namespace std;
int main()
{
ifstream fin("fact.in");
ofstream fout("fact.out");
int times, n, result;
fin >> times;
for(int i = 1; i <= times; i++)
{
result = 0;
fin >> n;
while((n/5) >= 1)
{
result += n/5;
n /= 5;
}
fout << result << endl;
}
fin.close();
fout.close();
return 0;
}