Cod sursa(job #2454576)
Utilizator | Data | 9 septembrie 2019 12:52:14 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{ifstream f("fact.in");
ofstream g("fact.out");
unsigned long long int p;
unsigned long int counter=0;
unsigned long long int x=1;
f>>p;
while(counter!=p){
int y=x;
while(y%5==0){
counter++;
y/=5;
}
x++;
}
if(p==0){
g<<1;
}else
g<<x-1;
return 0;
}