Cod sursa(job #2159194)

Utilizator VladP02Popescu Vlad VladP02 Data 10 martie 2018 19:59:25
Problema Factorial Scor 10
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;
}