Cod sursa(job #1632164)
Utilizator | Data | 5 martie 2016 22:11:30 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
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==0)
fprintf(fo, "1\n");
else
{
fprintf(fo, "%.0ld\n", (p)*5);
}
fclose(fi);
fclose(fo);
return 0;
}