Advertisement
kidinhvao

B02_NMCNTT_W02

Jan 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. before, now = map(int, (input("Nhập chỉ số điện tháng trước và tháng này: ").split()))
  2. num = now - before
  3. temp = num
  4. cash = 0
  5.  
  6. if (num > 400):
  7. temp -= 400
  8. cash += temp*2701
  9. temp = num - temp
  10. if (num > 300):
  11. temp -= 300
  12. cash += temp*2615
  13. temp = num - temp
  14. if (num > 200):
  15. temp -= 200
  16. cash += temp*2340
  17. temp = num - temp
  18. if (num > 100):
  19. temp -= 100
  20. cash += temp*1858
  21. temp = num - temp
  22. if (num > 50):
  23. temp -= 50
  24. cash += temp*1600
  25. temp = num - temp
  26. if (num <= 50):
  27. cash += temp*1549
  28.  
  29. cash *= 1.1
  30.  
  31. print("Số tiền điện phải trả: {}".format(cash))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement