Cod sursa(job #1219034)

Utilizator yaquzoSimion Andrei yaquzo Data 13 august 2014 11:12:40
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <iostream>
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
 unsigned Max=100000000;

unsigned rezolvare(unsigned p)
{unsigned i;
   for(i=0;i<Max;i++)
    if(i==p && i<5)
   break;
   return i*5;
   else (i*5)-5;
}


int main()

{unsigned p,N;
    f>>p;
    if(p==0)
    N=1;
    else
    N=rezolvare(p);

    g<<N;
    f.close();
    g.close();
    return 0;
}