题解
2024-11-30 09:41:38
发布于:浙江
0阅读
0回复
0点赞
#include <iostream>
using namespace std;
int main() {
int x, y, z;
cin >> x >> y >> z;
// 计算最多能购买的奖品数量
int num_items = y / x;
// 计算购买奖品后的剩余金额
int remaining_money = y - num_items * x;
// 判断剩余金额是否足够购买零食
if (remaining_money >= z) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
这里空空如也
有帮助,赞一个