mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-11-27 08:26:20 +00:00
21 lines
249 B
C
21 lines
249 B
C
#include <stdio.h>
|
|
|
|
int main() {
|
|
double a, x;
|
|
|
|
scanf("%lf %lf", &a, &x);
|
|
|
|
int count = 1;
|
|
double sum = a;
|
|
|
|
while (sum < x) {
|
|
a *= 0.98;
|
|
sum += a;
|
|
count++;
|
|
}
|
|
|
|
printf("%d\n", count);
|
|
|
|
return 0;
|
|
}
|