Cod sursa(job #1245671)
Utilizator | Data | 19 octombrie 2014 20:12:58 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 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;
k=k*5;
g<<k;
return 0;
}