Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var day int
- fmt.Scanln(&day)
- var workdayMinutes = (365 - day) * 63
- var holidayMinutes = day * 127
- var totalMinutes = workdayMinutes + holidayMinutes
- var diffMinutes = int(math.Abs(float64(totalMinutes) - 30000))
- if (totalMinutes >= 30000) {
- fmt.Println("Tom will run away")
- fmt.Printf("%d hours and %d minutes more for play", diffMinutes / 60, diffMinutes % 60)
- } else {
- fmt.Println("Tom sleeps well")
- fmt.Printf("%d hours and %d minutes less for play", diffMinutes / 60, diffMinutes % 60)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement