3 条题解

  • 0
    @ 2025-2-7 22:54:55
    num = int(input())
    price = 0.0
    if num<=150:
        price += num*0.4463
    else:
        price += 150*0.4463 # 小于150的部分
        num -= 150
        if num<=250:
            price += num*0.4663
        else:
            price += 250*0.4663
            num -= 250
            price += num*0.5663
    print(f"{price:.1f}")
    
    
    • 0
      @ 2024-11-1 18:45:47
      #include<bits/stdc++.h>
      using namespace std;
      int main(){
          double e,money=0;
          cin>>e;
          if(e<=150)	
              money=e*0.4463;
          if(e>150||e==400)	
              money=150*0.4463+(e-150)*0.4663;
          if(e>400)		
              money=150*0.4463+250*0.4663+(e-400)*0.5663;
          printf("%.1lf\n",money);
          return 0;
      }
      
      • -1
        @ 2024-11-10 10:38:08
        #include<bits/stdc++.h>
        using namespace std;
        int main(){
        	int n;
        	cin>>n;
        	if(n<=150)cout<<fixed<<setprecision(1)<<n*0.4463;
        	else if(n>=150&&n<=400)cout<<fixed<<setprecision(1)<<150*0.4463+(n-150)*0.4663;
        	else cout<<fixed<<setprecision(1)<<150*0.4463+250*0.4663+(n-400)*0.5663;
        	return 0;
        }
        
        • 1

        信息

        ID
        5480
        时间
        1000ms
        内存
        125MiB
        难度
        1
        标签
        (无)
        递交数
        692
        已通过
        337
        上传者