Cod sursa(job #1971535)

Utilizator stefifranciskaBogdan Stefania Franciska stefifranciska Data 20 aprilie 2017 15:35:29
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include <iostream>
#include <fstream>
using namespace std;


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

      if(P==0) N=1;
        else
        {
            if((P+1)%6==0) N=-1;
                else N=(P-P/6)*5;
        }
    g<<N;

    return 0;
}