ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฉ๐ป๐ป ๋ฌธ์
โ๐ป ํ์ด
๐จ Go
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
var h, m int
reader := bufio.NewReader(os.Stdin)
fmt.Fscanln(reader, &h, &m)
if m-45 >= 0 {
fmt.Printf("%d %d\n", h, m-45)
} else if h == 0 {
fmt.Printf("%d %d\n", 23, 15+m)
} else {
fmt.Printf("%d %d\n", h-1, 15+m)
}
}
๐จ Python3
import sys
h, m = sys.stdin.readline().split()
h, m = int(h), int(m)
if m - 45 < 0:
m = m + 15
if h - 1 < 0:
h = h + 23
else:
h = h - 1
else:
m = m - 45
print(h, m)
728x90
'dev > algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
BOJ / 10950๋ฒ / A+B-3 [Go] [Python3] (0) | 2020.03.20 |
---|---|
BOJ / 2739๋ฒ / ๊ตฌ๊ตฌ๋จ [Go] [Python3] (0) | 2020.03.19 |
BOJ / 2753๋ฒ / ์ค๋ [Go] [Python3] (0) | 2020.03.17 |
BOJ / 9498๋ฒ / ์ํ ์ฑ์ [Go] [Python3] (0) | 2020.03.16 |
BOJ / 1330๋ฒ / ๋ ์ ๋น๊ตํ๊ธฐ [Go] [Python3] (0) | 2020.03.15 |
๋๊ธ
๊ธ ๋ณด๊ดํจ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
TAG
- ๋ชฝ๊ณ ๋๋น
- ๋งฅ๋ถ ์ ๊ทธ๋ ์ด๋
- ์๊ฐ๊ต์ฒด
- Golang
- Algorithm
- ํ๋ก์ด๋์์ฌ
- ๋ฐฑ์ค
- dp
- ์๊ณ ๋ฆฌ์ฆ
- ๋ธ๋ฃจํธํฌ์ค
- ์๋ฐ
- go
- ๋ฐ๋
- ํด์๋งต
- ์คํ
- Macbook pro 2012 mid 13
- BFS
- python3
- java
- baekjoon
- ์ด๋ถํ์
- ํ
- BOJ
- dfs
- ballet
- MongoDB
- AWS
- ๋ถํ ์ ๋ณต
- ๋งฅ๋ถ
- ๋งฅ๋ถํ๋ก
- Total
- Today
- Yesterday