最近光剩下寫這種無聊練習題了,不說廢話,問題如下:
問題簡單,無需注釋
lockPrice = 45
stockPrice = 30
barrelPrice = 25
lockNum = int(input("槍機數量:"))
stockNum = int(input("槍托數量:"))
barrelNUm = int(input("槍管數量:"))
if lockNum < 1 or stockNum < 1 or barrelNUm < 1:
exit("未達標,不予計算!")
if lockNum > 70 or stockNum > 80 or barrelNUm > 90:
exit("虛報銷售數量,不予計算!")
allCash = lockNum * lockPrice + stockNum * stockPrice + barrelNUm * barrelPrice
if allCash > 1800:
profit = (allCash - 1800) * 0.2 + 800 * 0.15 + 1000 * 0.1
elif allCash > 1000:
profit = (allCash - 1000) * 0.15 + 1000 * 0.1
else:
profit = allCash * 0.1
print("=" * 30)
print("銷售槍機數量:%d" % lockNum)
print("銷售槍托數量:%d" % stockNum)
print("銷售槍管數量:%d" % barrelNUm)
print("總銷售額:%d" % allCash)
print("總利潤為:%d" % profit)
print("=" * 30)
項目介紹疫情數據可視化分析系統采用Django框架,基於my