Cod sursa(job #2595270)
Utilizator | Data | 7 aprilie 2020 14:18:44 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main()
{
int n,p,x,k=0;
in>>p;
if(p==0)
out<<1;
else
{
x=p;
while(x>=5)
{
k++;
x=p/5;
}
out<<(p-k)*5;
}
}