Advertisement
Spocoman

Maiden Party

Oct 10th, 2024
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.94 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.   "fmt"
  5.   "math"
  6. )
  7.  
  8. func main() {
  9.     var partyPrice float64
  10.     fmt.Scanln(&partyPrice)
  11.    
  12.     var loveMessageCount, waxRoseCount, keychainCount, caricatureCount, luckySurpriseCount int
  13.     fmt.Scanln(&loveMessageCount)
  14.     fmt.Scanln(&waxRoseCount)
  15.     fmt.Scanln(&keychainCount)
  16.     fmt.Scanln(&caricatureCount)
  17.     fmt.Scanln(&luckySurpriseCount)
  18.  
  19.     totalCount := loveMessageCount + waxRoseCount + keychainCount + caricatureCount + luckySurpriseCount
  20.  
  21.     budget := float64(loveMessageCount) * 0.60 + float64(waxRoseCount) * 7.20 + float64(keychainCount) * 3.60 + float64(caricatureCount) * 18.20 + float64(luckySurpriseCount) * 22
  22.  
  23.     if totalCount >= 25 {
  24.         budget *= 0.65
  25.     }
  26.  
  27.     budget = budget * 0.9 - partyPrice
  28.  
  29.     if budget >= 0 {
  30.         fmt.Printf("Yes! %.2f lv left.", budget)
  31.     } else {
  32.         fmt.Printf("Not enough money! %.2f lv needed.", math.Abs(budget))
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement