Cod sursa(job #2190133)

Utilizator VladP02Popescu Vlad VladP02 Data 29 martie 2018 20:53:29
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");


int p,k,scadere;
int main()
{
    f>>p; if(p>=5) scadere=5;
    if(p==0) {g<<1;return 0;}
    while(p)
        {k=k+5;p--;}
    k=k-scadere;
    g<<k;

    cout<<k;
    return 0;
}