Advertisement
Spocoman

01. Sum Seconds

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