提交时间:2023-12-22 15:50:34
运行 ID: 34436
#include<iostream> using namespace std; int main() { int mom=0; int jin=0; bool not_enough_money=0; for(int i=0;i<12;i++){ int exp; cin>>exp; if(300+jin<exp){ not_enough_money=1; for(int j=i+1;j<12;j++){ int a; cin>>a; } cout<<-i-1; break; } jin=300+jin-exp; mom+=jin/100; jin=jin%100; } if(not_enough_money=0){ cout<<mom*1.2+jin; } return 0; }