Untitled
unknown
plain_text
2 years ago
320 B
9
Indexable
#include <stdio.h>
#include <math.h>
int main() {
double P;
scanf("%lf", &P);
double deposit = 1000;
int months = 0;
while (deposit <= 1100) {
deposit += deposit * P / 100;
months++;
}
printf("%d %.6lf", months, deposit);
return 0;
}Editor is loading...