Cod sursa(job #2913692)

Utilizator 13wannabedevPatrik Benczik 13wannabedev Data 16 iulie 2022 02:41:13
Problema Factorial Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <fstream>

using namespace std;

int main() {
    ifstream cin("fact.in");
    ofstream cout("fact.out");
    int p, c = 0;
    cin >> p;

    if (p < 5)
        cout << -1;
    else if (p == 0)
        cout << 0;
    else
        for (int i = 0; i <= p; i += 5) {
            if (i == p) {
                cout << c;
                break;
            }
            c++;
        }
    return 0;
}