Cod sursa(job #2441001)

Utilizator dimos123Cretu Mihail-Dimosthenis dimos123 Data 19 iulie 2019 18:41:28
Problema Factorial Scor 35
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.27 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)
  {i+=5;
   int ci=i;
   while(ci%5==0)
    {ci=ci/5;
     p--;
    }
  }
g<<i;
}
else g<<1;
    return 0;
}