ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฉ๐ป๐ป ๋ฌธ์
โ๐ป ํ์ด
๐จ 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
- ballet
- BOJ
- Algorithm
- java
- ๋ธ๋ฃจํธํฌ์ค
- ํ
- ๋ฐฑ์ค
- dfs
- ์๊ฐ๊ต์ฒด
- ์๋ฐ
- python3
- ํด์๋งต
- ๋ชฝ๊ณ ๋๋น
- ์คํ
- ์๊ณ ๋ฆฌ์ฆ
- AWS
- ์ด๋ถํ์
- baekjoon
- MongoDB
- ๋งฅ๋ถ
- ๋ฐ๋
- ๋ถํ ์ ๋ณต
- Golang
- BFS
- ๋งฅ๋ถํ๋ก
- dp
- Macbook pro 2012 mid 13
- go
- ํ๋ก์ด๋์์ฌ
- ๋งฅ๋ถ ์ ๊ทธ๋ ์ด๋
- Total
- Today
- Yesterday