Run ID:104702
提交时间:2025-01-08 20:13:50
#include <iostream> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; // 读取苹果的数量n,虫子吃苹果的速率x,总时间y // 计算虫子在y小时内能吃的苹果数量 int applesEaten = y / x; // 计算剩余的苹果数量 int remainingApples = n - applesEaten; // 如果剩余苹果数量小于0,则为0 if (remainingApples < 0) { remainingApples = 0; } // 输出剩余的苹果数量 cout << remainingApples << endl; return 0; }