全部评论 1

  • #include <bits/stdc++.h>
    using namespace std;
    int main(){
    int n,x,y;
    cin>>n>>x>>y;
    if (y%x==0){
    	if (n-y/x<=0){  //吃完苹果
    		cout<<0;
    	}
    	else{
    		cout<<n-y/x;  //没吃完,由于是int直接向下取整
    	}
    }
    else{
    	if (n-(y/x+1)<=0){
    		cout<<0;
    	}
    	else{
    		cout<<n-(y/x+1); //没吃完,要+1
    	}
    }
    return 0;
    }
    

    2026-01-09 来自 山东

    0
暂无数据

提交答案之后,这里将显示提交结果~

首页