Cod sursa(job #2352946)

Utilizator AndreiGabriel.01Negreanu-Maior Andrei Gabriel AndreiGabriel.01 Data 23 februarie 2019 19:17:51
Problema Factorial Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.27 kb
#include <fstream>
using namespace std;

ifstream cin("fact.in");
ofstream cout("fact.out");

int main() {
     int r=0, f=5, n;
     cin >> n;
     while (f<=n) { 
          r+=n/f; 
          f*=5;
     }
     cout << r;
    cin.close();
    cout.close();
    return 0;
}