Cod sursa(job #1186833)

Utilizator teodor440Teodor Tonghioiu teodor440 Data 17 mai 2014 15:06:17
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;

ifstream f("factorial.in");
ofstream g("factorial.out");

int main()
{
    long a,x,i,k,j;
    f>>a;
    x=0;
    j=2;
    for(i=1;i<=a;i++){
        k=1;
        if(pow(5,j)){
            k=0;
            x-=5;
        }
        x+=5;
    }
    if(k)
    g<<x;
    else
    g<<-1;


    return 0;
}