I encounter a problem when try to make a pyramid of number in reverse of golang
I already can make a pyramid of number with this code :
var (
input, bil int
)
fmt.Scanln(&input)
bil = 9
for b := 1; b <= input; b++ {
for c := input; c >= b; c-- { //spasi
fmt.Print(" ")
}
for d := 1; d <= b; d++ { //bintang
fmt.Print(bil)
if bil == -1 {
bil = 9
}
bil = bil - 1
}
fmt.Println()
}
Input :
5
Output :
9
87
654
3210
98765
How do I make a reverse one like this
input:
5
Output
9
78
456
0123
56789