Cod sursa(job #1389877)

Utilizator thehuntestshadowDragomir Alexandru thehuntestshadow Data 16 martie 2015 18:27:15
Problema Factorial Scor 5
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <iostream>
#include<fstream>
using namespace std;

int main()
{
    int n;
    ifstream fin ("fact.in");
    fin >> n;
    ofstream fout ("fact.out");
    if(n==0)fout <<"1\n";
    else
    {
        int s=1;
        for(int i=1;i<=n;++i)
            s*=i;
            fout <<s<<"\n";
    }

    return 0;
}