Laitofai

Y | Cycle

Dec 10th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n,sum;
  8.     cin>>n;
  9.     sum=0;
  10.     sum+=n%5;
  11.     while(n>=5){
  12.         n/=5;
  13.     }
  14.     sum+=n;
  15.     cout<<sum;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment