Cod sursa(job #625307)
Utilizator | Data | 24 octombrie 2011 11:18:09 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<fstream>
using namespace std;
int x;
int main()
{
int i,y,ok=1,nr=0;
ifstream f("fact.in");
ofstream g("fact.out");
f>>x;
if(x==0)
g<<"1";
else
{
i=1;
while(ok!=0)
{
if(i*5<x)
nr=nr++;
else ok=0;
i++;;
}
g<<5*(x-nr);
}
f.close();
g.close();
return 0;
}