不是你什么意思啊,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
时间
1000ms
内存
256MiB
难度
7
标签
(无)
递交数
99
已通过
23
上传者