ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฉ๐ป๐ป ๋ฌธ์
โ๐ป ํ์ด
๐จ Go
package main
import (
"fmt"
"bufio"
"os"
)
func main() {
var length int
// use bufio for fast scan
reader := bufio.NewReader(os.Stdin)
writer := bufio.NewWriter(os.Stdout)
fmt.Fscanln(reader, &length)
var a, b int
for i:=0; i<length; i++ {
fmt.Fscanln(reader, &a, &b)
fmt.Fprintln(writer, a+b)
}
writer.Flush()
}
golang ๋น ๋ฅธ ์ ์ถ๋ ฅ์ ์ํด์ bufio๋ฅผ ์ฌ์ฉํ์๋ค
๐จ Python3
import sys
t = int(sys.stdin.readline())
for i in range(t):
a, b = map(int, sys.stdin.readline().split())
print(a+b)
python ๋น ๋ฅธ ์ ์ถ๋ ฅ์ ์ํด์ sys.stdin์ ์ฌ์ฉํ์๋ค
728x90
'dev > algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
BOJ / 2742๋ฒ / ๊ธฐ์ฐ N [Go] [Python3] (0) | 2020.03.24 |
---|---|
BOJ / 2741๋ฒ / N ์ฐ๊ธฐ [Go] [Python3] (0) | 2020.03.23 |
BOJ / 8393๋ฒ / ํฉ [Go] [Python3] (0) | 2020.03.21 |
BOJ / 10950๋ฒ / A+B-3 [Go] [Python3] (0) | 2020.03.20 |
BOJ / 2739๋ฒ / ๊ตฌ๊ตฌ๋จ [Go] [Python3] (0) | 2020.03.19 |
๋๊ธ
๊ธ ๋ณด๊ดํจ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
TAG
- dfs
- MongoDB
- ๋ธ๋ฃจํธํฌ์ค
- ์ด๋ถํ์
- Golang
- Macbook pro 2012 mid 13
- ํ
- ๋ฐฑ์ค
- go
- BOJ
- ์๋ฐ
- baekjoon
- ์๊ณ ๋ฆฌ์ฆ
- BFS
- ๋งฅ๋ถ ์ ๊ทธ๋ ์ด๋
- ์๊ฐ๊ต์ฒด
- dp
- python3
- AWS
- java
- Algorithm
- ํด์๋งต
- ๋ชฝ๊ณ ๋๋น
- ๋งฅ๋ถํ๋ก
- ๋ถํ ์ ๋ณต
- ๋ฐ๋
- ํ๋ก์ด๋์์ฌ
- ์คํ
- ๋งฅ๋ถ
- ballet
- Total
- Today
- Yesterday