Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var budget, fuel float64
- fmt.Scanln(&budget)
- fmt.Scanln(&fuel)
- sum := 2.10 * fuel + 100
- var day string
- fmt.Scanln(&day)
- if day == "Saturday" {
- sum *= 0.90
- } else {
- sum *= 0.80
- }
- if budget >= sum {
- fmt.Printf("Safari time! Money left: %.2f lv.\n", budget - sum)
- } else {
- fmt.Printf("Not enough money! Money needed: %.2f lv.\n", sum - budget)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement