Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
7569 李成蹊 津津的储蓄计划 C++ 通过 0 MS 252 KB 448 2023-02-04 21:46:29

Tests(1/1):


#include<iostream> #include<cmath> using namespace std; int main() { int ml=0; int mmm=0; int total_w=0; int w_month=13; for(int i=1;i<=12;i++){ ml+=300; int a_i; cin>>a_i; if(a_i>ml){ total_w+=1; if(i<w_month) { w_month=i; } } else{ ml=(300-a_i)%100; mmm+=(300-a_i)-ml; } } ml+=(float)(1.2*mmm); if(total_w>=1){ cout<<"-"<<w_month; } else{ cout<<ml; } return 0; }


测评信息: