Cod sursa(job #2987644)

Utilizator noobmaster420sheeeesh 69 noobmaster420 Data 2 martie 2023 17:34:19
Problema Factorial Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main()
{
    int p;
    in>>p;
    if(p==0)
    {
        out<<1;
        return 0;
    }
    int ct=0,rez=0;
    while(ct<p)
    {
        rez+=5;
        if(rez%25==0)
            ct+=2;
        else
            ct++;
    }
    out<<rez;
    return 0;
}