Run ID:108986
提交时间:2025-01-23 21:09:16
#include <iostream> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; // 读取输入的三个正整数 // 计算虫子在y小时内能吃掉的苹果数 int eaten_apples = y / x; // 计算剩下的苹果数 int remaining_apples = n - eaten_apples; // 如果剩下的苹果数小于0,则输出0 if (remaining_apples < 0) { remaining_apples = 0; } cout << remaining_apples- 1 << endl; // 输出剩下的苹果数 return 0; }