Advertisement
desislava_topuzakova

2. Spaceship

Apr 16th, 2018
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import math
  2. width = float(input())
  3. length = float(input())
  4. heigth = float(input())
  5. astHeigth = float(input())
  6.  
  7. volume = width * length * heigth
  8. volumeRoom = (astHeigth + 0.40) * 2 * 2
  9. countAstr = (int) (math.floor(volume / volumeRoom))
  10.  
  11. if countAstr >= 3 and countAstr <= 10:
  12.     print("The spacecraft holds %d astronauts." % countAstr)
  13. elif countAstr < 3:
  14.     print("The spacecraft is too small.")
  15. elif countAstr>10:
  16.     print("The spacecraft is too big.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement