Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var km int
- fmt.Scanln(&km)
- var time string
- fmt.Scanln(&time)
- var price = 0.0
- if (km < 20) {
- if (time == "day") {
- price = float64(km) * 0.79 + 0.70
- } else {
- price = float64(km) * 0.90 + 0.70
- }
- } else if (km >= 100) {
- price = float64(km) * 0.06
- } else {
- price = float64(km) * 0.09
- }
- fmt.Printf("%.2f\n", price)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement