1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 15:48:42 +00:00
202401-programming-assignments/【实践课外】1.顺序结构/7-2 计算存款利息.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;
}