2 条题解

  • 1
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        int x,y,n,p;
        cin>>x>>y>>n>>p;
        double p1=p,m;;
        if (p>=x){
            p1=p-y;
        }
        double p2=p*n/10.0;
        if (p1<p2) {
            m=p1;
        }else{
            m=p2;
        }
        cout<<fixed<<setprecision(2)<<m<<endl;
        return 0;
    }
    
    
  • -1

    #include<bits/stdc++.h>
    using namespace std;
    int main( )
    {
    int x,n;
    double y,p,sum1,sum2;
    cin>>x>>y>>n>>p;
    sum2=p*n/10.0;
    if (p>=x)
    {
    sum1=p-y;
    if (sum1<=sum2)
    cout<<fixed<<setprecision(2)<<sum1;
    else
    cout<<fixed<<setprecision(2)<<sum2;

    }
    else
    cout<<fixed<<setprecision(2)<<sum2;

    return 0;

    }

  • 1

信息

ID
2969
难度
6
分类
(无)
标签
递交数
244
已通过
64
通过率
26%
上传者