Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace TMath;
- int quiz2(){
- long x;
- cout << "we will determine the number of trailing zeros at the end of X! enter the number X" << endl;
- cin >> x;
- int p;
- for(int i=1; i<=x; i++){
- cout << "i = " << i << endl;
- int ans;
- if (i%5==0){
- cout << "5n is detected" << endl;
- for(p=1;p<=i;p++){
- cout << "p =" << p << endl;
- int a=Power(5,p);
- cout << "a =" << a << endl;
- if (i/a==0)
- {ans=p-1;
- break;}
- }
- cout << ans;
- }
- }
- int total;
- total = total+ans;
- cout << "total = " << total;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement