Run ID:1760
提交时间:2023-11-05 00:10:56
#include <iostream> int main() { int year, amount; std::cin >> year >> amount; int total = amount; int interest = 20; // 平年收益率为20% for (int i = 1; i <= 10; i++) { if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) { interest = 30; // 闰年收益率为30% } else { interest = 20; // 平年收益率为20% } total += total * interest / 100; year++; } std::cout << total << std::endl; return 0; }