Cod sursa(job #2159241)

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

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