比较简单,go实现的话就是四舍五入的问题,(+0.5然后向下取整)
package main
import (
"fmt"
"math"
)
func main() {
var C1,C2 float64
_, _ = fmt.Scanf("%f %f", &C1, &C2)
result := int(math.Floor((C2 - C1)/100.0 + 0.5))
s := result % 60
result = result / 60
i := result % 60
result = result / 60
fmt.Printf("%02d:%02d:%02d\n", result, i, s)
}