Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var partyPrice float64
- fmt.Scanln(&partyPrice)
- var loveMessageCount, waxRoseCount, keychainCount, caricatureCount, luckySurpriseCount int
- fmt.Scanln(&loveMessageCount)
- fmt.Scanln(&waxRoseCount)
- fmt.Scanln(&keychainCount)
- fmt.Scanln(&caricatureCount)
- fmt.Scanln(&luckySurpriseCount)
- totalCount := loveMessageCount + waxRoseCount + keychainCount + caricatureCount + luckySurpriseCount
- budget := float64(loveMessageCount) * 0.60 + float64(waxRoseCount) * 7.20 + float64(keychainCount) * 3.60 + float64(caricatureCount) * 18.20 + float64(luckySurpriseCount) * 22
- if totalCount >= 25 {
- budget *= 0.65
- }
- budget = budget * 0.9 - partyPrice
- if budget >= 0 {
- fmt.Printf("Yes! %.2f lv left.", budget)
- } else {
- fmt.Printf("Not enough money! %.2f lv needed.", math.Abs(budget))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement