fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. double l, k;
  7. cin >> l >> k;
  8. const double c = 1e-5; //вводим константу
  9. cout << (int) log (l - c) / log (k);
  10. return 0;
  11. }
Success #stdin #stdout 0s 15232KB
stdin
9876543 21
stdout
5.25534