逻辑:
1.获取工号和工作时间
2.按正常工资计算出应发工资
3.判断两种特殊情况做处理
参考代码:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
workNum = int(input('输入工号:'))
workTime = int(input('输入工作时间:'))
hourWage = 84
totalWage = hourWage*workTime
if workTime > 120:
totalWage += hourWage*0.15*(workTime-120)
elif workTime < 60:
totalWage -= 700
print("员工:", workNum, " 应发工资:", totalWage)