Cod sursa(job #1620620)
| Utilizator | Data | 29 februarie 2016 11:21:37 | |
|---|---|---|---|
| Problema | Factorial | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.28 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{unsigned long long P,x=0,y;
f>>P;
if(P==0) g<<1;
else{
while(P)
{
x+=5;
y=x;
while(!(y%5)){y/=5; P--;}
}
g<<x;}
return 0;
}
