Cod sursa(job #1221935)

Utilizator cristighrCristi Gherghina cristighr Data 21 august 2014 18:23:20
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <iostream>
#include <fstream>

using namespace std;

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

int main()
{
    int p; f>>p;
    int nr=0, k=0;
    if(p==0)
        g<<"1";
    else
    {
        while(k!=p)
        {
            k++;
            nr=nr+5;
        }
        g<<nr;
    }
    return 0;
}