Skip to content

Instantly share code, notes, and snippets.

@TheoKlein
Created August 12, 2016 05:50
Show Gist options
  • Select an option

  • Save TheoKlein/4fb7883a9f83533763bf2b04ee4c3f34 to your computer and use it in GitHub Desktop.

Select an option

Save TheoKlein/4fb7883a9f83533763bf2b04ee4c3f34 to your computer and use it in GitHub Desktop.
ZeroJudge d122
#include <iostream>
using namespace std;
int main() {
long int n;
while(cin >> n){
int count = 0;
while(n > 4){
n -= n % 5;
count += n / 5;
n /= 5;
}
cout << count << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment