80分求助!!!大佬帮忙看一下!!!
查看原帖
80分求助!!!大佬帮忙看一下!!!
725114
ptsxlhs楼主2024/4/3 09:33
#include<bits/stdc++.h>
using namespace std;

int main(){
	int sum=0,old=0,a=0;
	bool b=false;
	for(int i = 1; i<=12; i++){
		int m;
		cin>> m;
		m=300-m+old;
		sum+=(m/100)*100;
		old=m%100;
		if(old<0){
			b=true;
			a=i;
		}
	}
	if(b){
		cout<< "-" << a;
	}else{
		cout<< old+sum*1.2;
	}
	return 0;
}
2024/4/3 09:33
加载中...