結果

問題 No.525 二度寝の季節
ユーザー R_F
提出日時 2017-11-24 00:59:11
言語 Go
(1.23.4)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 553 bytes
コンパイル時間 10,135 ms
コンパイル使用メモリ 236,780 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-27 06:04:47
合計ジャッジ時間 11,274 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"strconv"
	"strings"
)

func changeHour(hour, minutes *int) {
	*minutes += 5
	if *minutes >= 60 {
		*hour += 1
		*minutes -= 60
	}
	if *hour == 24 {
		*hour = 0
	}
}

func intToStoring(num *int) {
	if *num < 10 {
		fmt.Printf("0%d", *num)
	} else {
		fmt.Printf("%d", *num)
	}
}

func main() {
	var num string
	fmt.Scan(&num)
	list := strings.Split(num, ":")
	hour, _ := strconv.Atoi(list[0])
	minutes, _ := strconv.Atoi(list[1])
	changeHour(&hour, &minutes)
	intToStoring(&hour)
	fmt.Print(":")
	intToStoring(&minutes)
}
0