Cod sursa(job #262875)
Utilizator | Data | 19 februarie 2009 18:36:56 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include<fstream>
using namespace std;
int main()
{
int p,i,l;
ifstream in("fact.in");
ofstream out("fact.out");
in>>p;
i=p*5;
l=i;
l=l/5;
while (l!=0)
{if (l%5==0) l--;
l=l/5;
i=i-l*5;}
out<<i;
in.close();
out.close();
return 0;
}