无聊,发个正确代码
查看原帖
无聊,发个正确代码
1277913
Zebraj楼主2024/3/13 21:54

题解如下

#include<bits/stdc++.h>
using namespace std;
int main() {
    int m,t,s;
    cin>>m>>t>>s;
    if(t==0){
		cout<<0<<endl;
		return 0;
	}
    if(s%t==0){
    	if(m-s/t<0){
    		cout<<0;
		}else{
    		cout<<m-s/t;
		}
	}else{
		if(m-s/t-1<0){
    		cout<<0;
		}else{
    		cout<<m-s/t-1;
		}
	}
    return 0;
}
2024/3/13 21:54
加载中...