Cod sursa(job #1645934)

Utilizator paulstepanovStepanov Paul paulstepanov Data 10 martie 2016 14:24:24
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("factorial.in");
ofstream fout("factorial.out");

int factorial(int x)
{
    if(x==0) return 1;
    if(x==1) return 5;
    if(x==2) return 10;
    if(x>2) return 5*(x-1);
}
int main()
{
    int n;
    fin>>n;
    fout<<factorial(n);
}