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