1 条题解
-
0YUIS (丶tc守望者) LV 8 MOD @ 2019-06-12 21:12:11
#include<iostream>
using namespace std;int main(){
double x=0;
int a[15] = {0},b[15] = {0},c,xout;
bool flag = true;
for(int i=1;i<=12;i++){
cin >> a[i];
if(300-a[i]+b[i-1]>=0){
if(300-a[i]+b[i-1]>=100){
x=x+(((300-a[i]+b[i-1])/100)*100);
b[i]=300-a[i]+b[i-1]-(((300-a[i]+b[i-1])/100)*100);
}else{
b[i]=300-a[i]+b[i-1];
}
}else{
flag = false;
xout=i;
break;
}
}
x=x*1.2+b[12];
c=x;
if(flag){
cout << c;
}
else cout << -xout;
return 0;
}
- 1