Advertisement
Spocoman

03. Time + 15 Minutes

Sep 16th, 2024
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.29 KB | None | 0 0
  1. package main
  2. import "fmt"
  3.  
  4. func main() {
  5.     var hour, minute int
  6.     fmt.Scanln(&hour)
  7.     fmt.Scanln(&minute)
  8.  
  9.     var totalMinutes = hour * 60 + minute + 15
  10.     var hours = totalMinutes / 60 % 24
  11.     var minutes = totalMinutes % 60
  12.  
  13.     fmt.Printf("%d:%02d\n", hours, minutes)
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement