top1编程
← 返回题目
题解

【入门】薪水计算

1 条题解

  • 0
    @ 2026-7-29 0:17:51
    #include<bits/stdc++.h>
    using namespace std;
    double money;
    int main(){
         int n;
         float m;
         cin>>n>>m;
         if(n<=40){
              money=m*n;
         }else if(n<=50){
              money=40*m+(n-40)*1.5*m;
         }else{
              money=55*m+(n-50)*2*m;
         }
         cout << fixed << setprecision(2) <<money;;
         return 0;
    }
    
    • 1