Cod sursa(job #2758211)
Utilizator | Data | 8 iunie 2021 22:19:49 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<cstdio>
using namespace std;
int main()
{
FILE *f=fopen("fact.in","r"),*g=fopen("fact.out","w");
int x,facto=1,c=0,i,factor;
bool gasit=false;
fscanf(f,"%i",&x);
if(x==0)
fprintf(g,"1");
else
if(x<0)
fprintf(g,"-1");
else
fprintf(g,"%i",x*5);
fclose(f);
fclose(g);
return 0;
}