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