Cod sursa(job #2844907)

Utilizator xDemonstyMatei Haba Ionut xDemonsty Data 6 februarie 2022 10:16:33
Problema Factorial Scor 5
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <fstream>

using namespace std;

ifstream in ( "fact.in");
ofstream out("fact.out") ;

int n , p  , nr = 0 ;

int main()
{
    in >> p ;
    while ( p > 0 )
    {
        nr = nr + 5 ;
        if ( nr == 10 )
        p = p - 2  ;
        else
            p -- ;
    }

    out << nr ;
    return 0;
}