Cod sursa(job #34183)
Utilizator | Data | 20 martie 2007 12:32:52 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.24 kb |
#include<fstream.h>
int main()
{
ifstream in("fact.in");
ofstream out("fact.out");
int i=1,n,c2=0,c5=0;
in>>n;
while(n!=0)
{
i++;
if(i%5==0)
c5++;
if(c5==n-1)
{
out<<i;
n=0;
}
}
in.close();
out.close();
return 0;
}