Untitled

 avatar
unknown
plain_text
a year ago
320 B
4
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;
}