mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-11-23 21:58:41 +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;
|
||
|
}
|