Cod sursa(job #2436378)

Utilizator qfl1ck32Andrei qfl1ck32 Data 5 iulie 2019 16:46:34
Problema Factorial Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
    long long int P;
    fin>>P;
    if (P % 6 == 5)
        fout<<-1;
    if (P == 0)
        fout<<1;
    else
        fout<<5*P - (P/5)*5;
    fin.close();
    fout.close();
    return 0;
}