为社么WA???0分???
查看原帖
为社么WA???0分???
1366537
coderzhx楼主2024/6/7 19:39

#include <iostream>
using namespace std;



int x, y, z, k;

int main() {
	cin >> x;
	cin >> y;
	cin >> z;
	cin >> k;
	if (2 * x + 5 * y + 3 * z <= k) {
		cout << "Yes" << endl;
		cout << k - 2 * x - 5 * y - 3 * z;
	} else {
		cout << "No" << endl;
		cout << 2 * x + 5 * y + 3 * z - k;
	}




	return 0;
}



#include <iostream>
using namespace std;



int x, y, z, k;

int main() {
	cin >> x;
	cin >> y;
	cin >> z;
	cin >> k;
	if (2 * x + 5 * y + 3 * z <= k) {
		cout << "Yes" << endl;
		cout << k - 2 * x - 5 * y - 3 * z;
	} else {
		cout << "No" << endl;
		cout << 2 * x + 5 * y + 3 * z - k;
	}




	return 0;
}

2024/6/7 19:39
加载中...