Cod sursa(job #557417)
| Utilizator | Data | 16 martie 2011 17:34:30 | |
|---|---|---|---|
| Problema | Factorial | Scor | 5 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.24 kb |
#include<fstream>
using namespace std;
int main ()
{
ifstream f("fact.in");
ofstream g("fact.out");
int p,n,x;
f>>p;
if(p==0)
n=1;
else
{
x=(p+1)/6;
n=p/2*10-5*x;
}
g<<n;
}
