Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var budget, towel, discount float64
- fmt.Scanln(&budget)
- fmt.Scanln(&towel)
- fmt.Scanln(&discount)
- umbrella := towel / 3 * 2
- flipFlops := umbrella * 0.75
- beachBag := (towel + flipFlops) / 3
- sum:= (towel + umbrella + flipFlops + beachBag) * (100 - discount) / 100
- fmt.Printf("Annie's sum is %.2f lv. ", sum)
- if budget >= sum {
- fmt.Printf("She has %.2f lv. left.", budget - sum)
- } else {
- fmt.Printf("She needs %.2f lv. more.", sum - budget)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement