ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฉ๐ป๐ป ๋ฌธ์
โ๐ป ํ์ด
๐จ Go
package main
import (
"fmt"
)
func main() {
var n int
fmt.Scanf("%d", &n)
var sum int
for i:=1; i<n+1; i++ {
sum += i
}
fmt.Println(sum)
}
๐จ Python3
import sys
n = int(sys.stdin.readline())
sum = 0
for i in range(1, n+1):
sum += i
print(sum)
728x90
'dev > algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
BOJ / 2741๋ฒ / N ์ฐ๊ธฐ [Go] [Python3] (0) | 2020.03.23 |
---|---|
BOJ / 15552๋ฒ / ๋น ๋ฅธ A+B [Go] [Python3] (0) | 2020.03.22 |
BOJ / 10950๋ฒ / A+B-3 [Go] [Python3] (0) | 2020.03.20 |
BOJ / 2739๋ฒ / ๊ตฌ๊ตฌ๋จ [Go] [Python3] (0) | 2020.03.19 |
BOJ / 2884๋ฒ / ์๋ ์๊ณ [Go] [Python3] (0) | 2020.03.18 |
๋๊ธ
๊ธ ๋ณด๊ดํจ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
TAG
- MongoDB
- Algorithm
- go
- ๋ธ๋ฃจํธํฌ์ค
- BOJ
- ๋งฅ๋ถ
- dp
- ์ด๋ถํ์
- dfs
- ๋งฅ๋ถํ๋ก
- ๋ชฝ๊ณ ๋๋น
- Golang
- java
- ์๋ฐ
- ์๊ฐ๊ต์ฒด
- ๋ฐ๋
- ํ๋ก์ด๋์์ฌ
- ๋งฅ๋ถ ์ ๊ทธ๋ ์ด๋
- python3
- BFS
- ์คํ
- Macbook pro 2012 mid 13
- ํ
- ๋ถํ ์ ๋ณต
- ๋ฐฑ์ค
- baekjoon
- ํด์๋งต
- ์๊ณ ๋ฆฌ์ฆ
- AWS
- ballet
- Total
- Today
- Yesterday