有一个点过不去
查看原帖
有一个点过不去
551975
tadehaobaba、楼主2021/8/18 20:35
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
    float m,t,s;
    float z,h;
    cin>>m>>t>>s;
    if(t==0)
    {
        cout<<m<<endl;
        return 0;
    }
    else
    {
        z=ceil(s/t);
        if(z>=m)
        {
            cout<<"0"<<endl;
            return 0;
        }
        else
        {
            h=m-z;
            cout<<floor(h)<<endl;
            return 0;
        }
    }
    
}
2021/8/18 20:35
加载中...