第四个数据点错误,求教
查看原帖
第四个数据点错误,求教
1193377
WayHang楼主2023/11/9 21:37
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int m,t,s;
    cin>>m>>t>>s;
    if(t==0) cout<<0<<endl;
    else if(t!=0)
    {
    if(s%t==0)
    {
        if((m-s/t)>0)
        cout<<m-s/t<<endl;
        else if((m-s/t)<=0)
        cout<<0<<endl;
    }
    else if(s%t!=0) 
    {
        if((m-s/t-1)>0)
        cout<<m-s/t<<endl;
        else if((m-s/t-1)<=0)
        cout<<0<<endl;
    }
    }
    return 0;
}
2023/11/9 21:37
加载中...