zoukankan      html  css  js  c++  java
  • 第二题

    Source file

    01 #T2
    02 # 企业发放的奖金根据利润提成。方案如下
    03 #       利润(I)低于或等于10万元时,奖金可提10%;
    04 #       利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.5%;
    05 #       20万到40万之间时,高于20万元的部分,可提成5%;40万到60万之间时高于40万元的部分,可提成3%;
    06 #       60万到100万之间时,高于60万元的部分,可提成1.5%,高于100万元时,超过100万元的部分按1%提成,
    07 #从键盘输入当月利润I,求应发放奖金总数?
    08 profit=float(input('please input your profit: '));
    09 if profit <= 10:
    10         bonus=1.1*profit;
    11 elif profit < 20:
    12         bonus=1.1*10+1.075*(profit-10);
    13 elif profit < 40:
    14         bonus=1.1*10+1.075*10*1.05*(profit-20);
    15 elif profit < 60:
    16         bonus=1.1*10+1.075*10+1.05*20+1.03*(profit-40);
    17 elif profit <100:
    18         bonus=1.1*10+1.075*10+1.05*20+1.03*20+1.015*(profit-60);
    19 elif profit >= 100:
    20         bonus=1.1*10+1.075*10+1.05*20+1.03*20+1.015*40+1.01*(profit-100);
    21 
    22 print('your bonus is '+str(bonus)+' million Yuan');
    
    为更美好的明天而战!!!
  • 相关阅读:
    django的用户认证模块(auth)
    算法
    图书管理系统
    mac系统中pycharm激活
    mac常见问题
    mysql安装
    restful规范及DRF基础
    MySQL存储引擎
    [python] with statement
    MySQL索引及执行计划
  • 原文地址:https://www.cnblogs.com/lovely-bones/p/11381475.html
Copyright © 2011-2022 走看看