Advertisement
Spocoman

Wedding Party

Oct 14th, 2024
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.51 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     "math"
  6. )
  7.  
  8. func main() {
  9.     var guests, budget int
  10.     fmt.Scanln(&guests)
  11.     fmt.Scanln(&budget)
  12.    
  13.     budget -= guests * 20
  14.  
  15.     if (budget < 0) {
  16.         fmt.Printf("They won't have enough money to pay the covert. They will need %d lv more.", budget * -1)
  17.     } else {
  18.         fmt.Printf("Yes! %d lv are for fireworks and %d lv are for donation.",
  19.                     int(math.Round(0.40 * float64(budget))), int(math.Round(0.60 * float64(budget))))
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement