Run ID:119700
提交时间:2025-05-18 15:25:28
#include <bits/stdc++.h> using namespace std; int main() { int y,b,c; cin>>y>>b; c=y+10; for(int i=y;i<=c;i++){ if(i%400==0||(i%4==0&&i%100!=0)){ b+=b*0.3; }else{ b+=b*0.2; } } cout<<b<<endl; return 0; } /* 1000 20% zong = 本金 + 收益 zong1 = 1000 + 1000*20%=1000(1+0.2) zong2 = 1000(1+0.2)+1000(1+0.2)*20%=1000(1+0.2)(1+0.2) zong3 = 1000(1+0.2)(1+0.2)+1000(1+0.2)(1+0.2)*20%=1000(1+0.2)(1+0.2)(1+0.2) */