Cod sursa(job #2476327)

Utilizator dimos123Cretu Mihail-Dimosthenis dimos123 Data 18 octombrie 2019 17:42:22
Problema Factorial Scor 40
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.3 kb
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{ int p;
  f>>p;
  int i=0;
  if(p!=0){
  while(p>0)
  {i+=5;
   int ci=i;
   while(ci%5==0)
    {ci=ci/5;
     p--;
    }
  }
if(p==0)
g<<i;
else g<<-1;
}
else g<<1;
    return 0;
}