Advertisement
Spocoman

Football Kit

Oct 9th, 2024
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.62 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var shirtsPrice, neededSum float64
  7.     fmt.Scanln(&shirtsPrice)
  8.     fmt.Scanln(&neededSum)
  9.  
  10.     shortsPrice := shirtsPrice * 0.75
  11.     socksPrice := shortsPrice / 5
  12.     sneakersPrice := (shirtsPrice + shortsPrice) * 2
  13.     totalSum := (shirtsPrice + shortsPrice + socksPrice + sneakersPrice) * 0.85
  14.  
  15.     if totalSum >= neededSum {
  16.         fmt.Printf("Yes, he will earn the world-cup replica ball!\nHis sum is %.2f lv.\n", totalSum)
  17.     } else {
  18.         fmt.Printf("No, he will not earn the world-cup replica ball.\nHe needs %.2f lv. more.\n", neededSum - totalSum)
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement