Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var shirtsPrice, neededSum float64
- fmt.Scanln(&shirtsPrice)
- fmt.Scanln(&neededSum)
- shortsPrice := shirtsPrice * 0.75
- socksPrice := shortsPrice / 5
- sneakersPrice := (shirtsPrice + shortsPrice) * 2
- totalSum := (shirtsPrice + shortsPrice + socksPrice + sneakersPrice) * 0.85
- if totalSum >= neededSum {
- fmt.Printf("Yes, he will earn the world-cup replica ball!\nHis sum is %.2f lv.\n", totalSum)
- } else {
- fmt.Printf("No, he will not earn the world-cup replica ball.\nHe needs %.2f lv. more.\n", neededSum - totalSum)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement