提交时间:2023-11-18 13:07:37

运行 ID: 31309

#include<iostream> #include<cmath> using namespace std; int main() { int moh=0,mtm=0; for(int i=1;i<=12;i++) { moh+=300; int sp; cin>>sp; if(moh<sp) { cout<<"-"<<i; return i; } else { int k=floor((moh-sp)/100); mtm+=100*k; moh-=100*k; moh-=sp; } } float tot=moh+mtm*1.2; cout<<tot; return 0; }