Cod sursa(job #1631874)
Utilizator | Data | 5 martie 2016 19:40:09 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void)
{
long p;
FILE *fi, *fo;
fi=fopen("fact.in", "r");
fo=fopen("fact.out", "w");
while (fscanf(fi, "%ld", &p) != EOF)
{
;
}
if(p<=1)
fprintf(fo, "1\n");
else
{
fprintf(fo, "%.0ld\n", (p-1)*5);
}
fclose(fi);
fclose(fo);
return 0;
}