Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var easterBreads, eggPacks, cookiesPerKg int
- fmt.Scanln(&easterBreads)
- fmt.Scanln(&eggPacks)
- fmt.Scanln(&cookiesPerKg)
- easterBreadsPrice := float64(easterBreads) * 3.20
- eggPacksPrice := float64(eggPacks) * 4.35
- dyeingEggsPrice := float64(eggPacks) * 12 * 0.15
- cookiesPrice := float64(cookiesPerKg) * 5.40
- sum := easterBreadsPrice + eggPacksPrice + dyeingEggsPrice + cookiesPrice
- fmt.Printf("%.2f\n", sum)
- }
- ИЛИ:
- package main
- import "fmt"
- func main() {
- var easterBreads, eggPacks, cookiesPerKg float64
- fmt.Scanln(&easterBreads)
- fmt.Scanln(&eggPacks)
- fmt.Scanln(&cookiesPerKg)
- fmt.Printf("%.2f\n", easterBreads * 3.20 + eggPacks * 4.35 + eggPacks * 12 * 0.15 + cookiesPerKg * 5.40)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement