Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //exponent
- #include <iostream>
- #include <cmath>
- using namespace std;
- long long n,i,j,k,p=1,exponentt;
- int main()
- {
- cin>>n>>k;
- p=1;
- while(pow(k,p)<n){
- exponentt+=floor(n/pow(k,p));
- p++;
- }
- cout<<exponentt;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement