Cod sursa(job #2987654)

Utilizator Lol150123Bruno Baciu Lol150123 Data 2 martie 2023 17:42:44
Problema Factorial Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.37 kb
#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;
}