Cod sursa(job #1725245)
Utilizator | Data | 5 iulie 2016 11:53:47 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include <bits/stdc++.h>
using namespace std;
int P,N,a,b;
int main(){
ifstream cin("fact.in");
ofstream cout("fact.out");
cin >> P;
if(!P) return cout << 1,0;
int rs = P*5,aux = P,k=0;
while(aux){
rs-=5*k;
k++;
aux/=5;
}
cout << rs;
return 0;
}