Cod sursa(job #1150300)

Utilizator SzabolcsSzekely Szabolcs Szabolcs Data 22 martie 2014 20:10:18
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.26 kb
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    ifstream f("fact.in");
    ofstream g("fact.out");

    int n;
    f>>n;
    if(n<0) g<<-1;
    else if(n==0) g<<1;
    else
    {
         g<<5*n;
    }

    return 0;
}