Cod sursa(job #1245679)
Utilizator | Data | 19 octombrie 2014 20:24:31 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
int n,k=0,s=0,c;
f>>n;
c=n;
while(n>=5)
{
k++;
n=n/5;
}
while(k!=0)
{
s=s+k;
k--;
}
k=(c-s)*5;
g<<k;
return 0;
}