Cod sursa(job #1150298)

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

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

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