Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
83680 bnu_fanmeijie 津津的储蓄计划 C++ 通过 0 MS 248 KB 600 2026-01-30 16:36:51

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; //存钱数,为t中包含的整百数,即 t - t % 100 } else//如果本月能用的钱小于预算 { cout<<-i; return 0; } } cout<<s*1.2 + m;//存款+利息+手里的钱 return 0; }


测评信息: