Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int nr_zero(int n) {
- int k = 0, p = 5;
- while(p<=n){
- k = k +n/p;
- p=p*5;
- }
- return k;
- }
- int main() {
- int k_maxx = -1, cnt = 0, a, n;
- while(cin>>n){
- a = nr_zero(n);
- if(a > k_maxx) {
- k_maxx = a;
- cnt = 1;
- }
- else if(a == k_maxx) cnt++;
- }
- cout << cnt << ' ' << k_maxx;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement