Advertisement
Spocoman

Pool Day

Oct 12th, 2024
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.46 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.   "fmt"
  5.   "math"
  6. )
  7.  
  8. func main() {
  9.     var people int
  10.     fmt.Scanln(&people)
  11.    
  12.     var entrancePrice, deskChairPrice, umbrellaPrice float64
  13.     fmt.Scanln(&entrancePrice)
  14.     fmt.Scanln(&deskChairPrice)
  15.     fmt.Scanln(&umbrellaPrice)
  16.    
  17.     total := entrancePrice * float64(people) + deskChairPrice * math.Ceil(0.75 * float64(people)) + umbrellaPrice * math.Ceil(float64(people) / 2)
  18.  
  19.     fmt.Printf("%.2f lv.\n", total)
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement