Cod sursa(job #720650)
Utilizator | Data | 22 martie 2012 20:05:26 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<fstream>
using namespace std;
long long n;
long long Factorial(long long x)
{
if(x== 0 || x == 1)
return 1;
return x * Factorial(x-1);
}
int main ()
{
ifstream fin("fact.in");
fin >>n;
fin.close();
ofstream fout("fact.out");
fout << Factorial(n) << "\n";
fout.close();
return 0;
}