Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var serialName string
- fmt.Scanln(&serialName)
- var serialTime, breakTime int
- fmt.Scanln(&serialTime)
- fmt.Scanln(&breakTime)
- var neededTime = float64(breakTime) / 8.0 + float64(breakTime) / 4.0 + float64(serialTime)
- if (neededTime <= float64(breakTime)) {
- fmt.Printf("You have enough time to watch %s and left with %.0f minutes free time.", serialName, float64(breakTime) - math.Floor(neededTime))
- } else {
- fmt.Printf("You don't have enough time to watch %s, you need %.0f more minutes.", serialName, math.Ceil(neededTime) - float64(breakTime))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement