Mai intai trebuie sa te autentifici.
Cod sursa(job #2016522)
Utilizator | Data | 29 august 2017 16:37:30 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
int n, x, s=0;
f>>n;
x=n;
while (x%5 == 0) {
s++;
x/=5;
}
while (n%25 == 0) {
s--;
x/=25;
}
g<<s;
return 0;
}