第七天 最佳存款方案
#include<iostream>
#include<cmath>
using namespace std;
int main() {
int n = 4;
double num;
num = 1000 / (1 + 12 * 0.0063);
while (n) {
num = (num + 1000) / (1 + 12 * 0.0063);
n--;
}
cout << num;
}
#include<iostream>
#include<cmath>
using namespace std;
int main() {
int n = 4;
double num;
num = 1000 / (1 + 12 * 0.0063);
while (n) {
num = (num + 1000) / (1 + 12 * 0.0063);
n--;
}
cout << num;
}