有点难

☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺  •  1年前


include <bits/stdc++.h>

using namespace std;

int main() {

int n, x = 0, y = 0, p = 0; //n为扣除的钱,x为津津手上的钱,y为妈妈那里的钱
for (int i = 0; i < 12; i++) {
	cin >> n;
	x = x + 300 - n;
	y = y + x / 100 * 100;
	p = x / 100 * 100;
	x = x - p;
	if (x < 0) {
		cout << -i - 1;
		return 0;
	}
}
cout << double(x + y * 1.2);
return 0;

}


评论:

请先登录,才能进行评论