请问为什么60分
查看原帖
请问为什么60分
1070029
Fate_money楼主2023/8/28 22:48
using namespace std;
int main(){
	double s{};
	double x{};
	cin >> s >>x;
	double rate = 7;
	double t = 0;
	double y = 0;
	if (s < x / 2&&s>0) {
		if (s + x / 2 > rate) {
			cout << 'y' << endl;
		}
		else {
			cout << 'n' << endl;
		}
	}
	if (s <= 0) {
		if (x / 2 + s > rate) {
			cout << 'y' << endl;
		}
		else {
			cout << 'n' << endl;
		}
	}
	while (y < s) {
		y = y + rate;
		rate *= 0.98;
	}
	if (y > s) {
		rate /= 0.98;
		t = (y - s) / rate;
		if ((t * rate + (1 - t) * rate * 0.98) < x) {
			cout << 'y' << endl;
		}
		else {
			cout << 'n' << endl;
		}
	}
	else {
		if (rate * 0.98 < x) {
			cout << 'y' << endl;
		}
		else {
			cout << 'n' << endl;
		}
	}
	system("pause");
	return 0; 
}  
2023/8/28 22:48
加载中...