mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-12-16 15:44:39 +00:00
15 lines
236 B
C
15 lines
236 B
C
#include <math.h>
|
|
#include <stdio.h>
|
|
|
|
int main() {
|
|
double money, year, rate;
|
|
|
|
scanf("%lf%lf%lf", &money, &year, &rate);
|
|
|
|
double k = pow(rate + 1, year);
|
|
|
|
printf("interest = %.2lf\n", money * k - money);
|
|
|
|
return 0;
|
|
}
|