Cod sursa(job #809317)

Utilizator viSuaL9Vladu Sorin viSuaL9 Data 8 noiembrie 2012 09:27:16
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include<iostream>
#include<fstream>

using namespace std;

ifstream f;
ofstream g;

int p,n;

void citire()
{
    f.open("fact.in");
    f >> p;
    f.close();
}

void scriere()
{
    g.open("fact.out");
    g << n;
    g.close();
}

int main()
{
    citire();
    if(p==0)
        n=1;
        else
        n=5*p;

    scriere();

    return 0;
}