不是你什么意思啊,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 条评论

  • 1

信息

ID
19
时间
ms
内存
MiB
难度
6
标签
(无)
递交数
177
已通过
58
上传者