Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var width, length, height, averageHeight float64
- fmt.Scanln(&width)
- fmt.Scanln(&length)
- fmt.Scanln(&height)
- fmt.Scanln(&averageHeight)
- spaceshipVolume := width * length * height
- astronautVolume := (averageHeight + 0.4) * 2 * 2
- team := int(spaceshipVolume / astronautVolume)
- if team < 3 {
- fmt.Println("The spacecraft is too small.")
- } else if team > 10 {
- fmt.Println("The spacecraft is too big.")
- } else {
- fmt.Printf("The spacecraft holds %d astronauts.", team)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement