Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
7686 鲁家菱 津津的储蓄计划 C++ 通过 0 MS 240 KB 421 2023-02-06 15:36:14

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int m=0,s=0,b,t;//m津津手中的钱,s存的钱,b每个月的预算 for(int i=1;i<=12;i++){ cin>>b; if(m+300>=b){ t=m+300-b;//t 预计本月末剩余的钱 m=t%100;//存钱后,手中剩余的钱 s+=t-m;//存钱数 } else{ cout<<-i; return 0; } } cout<<s*1.2+m;//存款+利息+手里的钱 return 0; }


测评信息: