ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฉ๐ป๐ป ๋ฌธ์
โ๐ป ํ์ด
๐จ Go
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
var n int
reader := bufio.NewReader(os.Stdin)
writer := bufio.NewWriter(os.Stdout)
fmt.Fscanln(reader, &n)
defer writer.Flush()
for i := 0; i < n; i++ {
for j := n - i - 1; j > 0; j-- {
fmt.Fprint(writer, " ")
}
for k := 0; k < i+1; k++ {
fmt.Fprint(writer, "*")
}
fmt.Fprint(writer, "\n")
}
}
๐จ Python3
import sys
n = int(sys.stdin.readline())
for i in range(n):
for j in range(n-i-1):
print(' ', end='')
for k in range(i+1):
print('*', end='')
print()
728x90
'dev > algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
BOJ / 10952๋ฒ / A+B - 5 [Go] [Python3] (0) | 2020.03.31 |
---|---|
BOJ / 10871๋ฒ / X๋ณด๋ค ์์ ์ [Go] [Python3] (0) | 2020.03.30 |
BOJ / 2438๋ฒ / ๋ณ ์ฐ๊ธฐ - 1 [Go] [Python3] (0) | 2020.03.28 |
BOJ / 11022๋ฒ / A+B - 8 [Go] [Python3] (0) | 2020.03.27 |
BOJ / 14681๋ฒ / ์ฌ๋ถ๋ฉด ๊ณ ๋ฅด๊ธฐ [Go] [Python3] (0) | 2020.03.26 |
๋๊ธ
๊ธ ๋ณด๊ดํจ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
TAG
- java
- ๋ถํ ์ ๋ณต
- MongoDB
- baekjoon
- ํด์๋งต
- BFS
- ์๊ฐ๊ต์ฒด
- go
- ๋งฅ๋ถ
- Algorithm
- ballet
- python3
- ์ด๋ถํ์
- ๋ชฝ๊ณ ๋๋น
- ๋ฐฑ์ค
- ํ๋ก์ด๋์์ฌ
- BOJ
- dp
- ๋ธ๋ฃจํธํฌ์ค
- ์๋ฐ
- Golang
- AWS
- ๋งฅ๋ถ ์ ๊ทธ๋ ์ด๋
- Macbook pro 2012 mid 13
- ์๊ณ ๋ฆฌ์ฆ
- ๋ฐ๋
- dfs
- ๋งฅ๋ถํ๋ก
- ํ
- ์คํ
- Total
- Today
- Yesterday