Advertisement
InnaSibirova

С новым годом!!!

Jan 2nd, 2022
1,361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <math.h>
  4.  
  5. int main()
  6. {
  7.    float x, p, step;
  8.    int n = 1;
  9.    scanf("%f", &x);
  10.    scanf("%f", &p);
  11.    step = p;
  12.    while(x / step >= 1) {
  13.        step *= p;
  14.        n++;
  15.    }
  16.    printf("%d", n);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement