- 苹果和虫子
警示后人
- 2024-12-26 21:07:17 @
不是你什么意思啊,Why x为0时要直接不运行哇!!!
C++代码:
#include <bits/stdc++.h>
using namespace std;
int n, x, y;
int main() {
cin >> n >> x >> y;
if (!x) return 0;
int m = ceil (1.0 * y / x);
int ans = n >= m ? n - m : 0;
cout << ans << endl;
return 0;
}
1 条评论
-
傅誉 LV 4 @ 2025-3-7 16:15:28
这边建议while True
- 1
信息
- ID
- 19
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 7
- 标签
- (无)
- 递交数
- 99
- 已通过
- 23
- 上传者