Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var days int
- fmt.Scanln(&days)
- var availableFood, deer1, deer2, deer3 float64
- fmt.Scanln(&availableFood)
- fmt.Scanln(&deer1)
- fmt.Scanln(&deer2)
- fmt.Scanln(&deer3)
- availableFood -= (deer1 + deer2 + deer3) * float64(days)
- if availableFood >= 0 {
- fmt.Printf("%d kilos of food left.", int(math.Floor(availableFood)))
- } else {
- fmt.Printf("%d more kilos of food are needed.", int(math.Ceil(math.Abs(availableFood))))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement