Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
1758 | 孙浚轩 | 13投资金额II | C++ | Wrong Answer | 0 MS | 256 KB | 542 | 2023-11-05 00:10:49 |
#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; }
------Input------
94 48
------Answer-----
405
------Your output-----
312