一、问题描述
二、设计流程
1.定义两个双精度浮点数a,b = 1000;
2.循环5次从后往前计算存款数;
3.循环内 a = b/(1 + 12 * 0.0063)
b = a + 1000;
三、流程图设计
四、代码实现
#include <iostream>
using namespace std;
int main() {
double k = 1 + 12 * 0.0063;
double ben = 0;
for (int i = 0; i < 5; i++) {
ben = (ben + 1000) / k;
}
printf("%lf", ben);
}
标签:0.0063,ben,4.19,int,打卡,建民,1000 From: https://www.cnblogs.com/cor0000/p/17330918.html