以下是使用 Python 语言解决此问题的代码: ```python import math years, hours = map(int, input().split()) if years < 5: normal_rate = 30 else: normal_rate = 50 if hours <= 40: salary = hours * normal_rate else: salary = 40 * normal_rate + (hours - 40) * normal_rate * 1.5 print("%.2f" % salary) ``` 当您运行此代码时,它会提示您输入员工的入职年数和周工作时间,然后按照给定的规则计算并输出周薪,精确到小数点后 2 位。 [2024-10-29 12:00:33 | AI写代码神器 | 156点数解答]