1 solutions

  • 1
    @ 2026-4-19 15:43:06
    #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
    	double x,y,n,p;
    	cin>>x>>y>>n>>p; 
    	               	
    	double m=p;  //算出第一种优惠多少元
    	if(p>=x)
    	{
    		m=p-y;
    	}
    	n=n*0.1;
    	double v=p*n;
    		//算出第二种优惠多少元
    
    
    	// 对比那个便宜一些  
    	if(m>v)
    	{
    		cout<<fixed<<setprecision(2)<<v;//
    	}
    	else
    	{
    		cout<<fixed<<setprecision(2)<<m;
    	}
    	return 0;
    	
    }
    
    
    • 1

    Information

    ID
    2884
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    # Submissions
    82
    Accepted
    16
    Uploaded By