Created
March 30, 2017 13:22
-
-
Save ranapu/91b6d66e54600dcc78d454c188978b09 to your computer and use it in GitHub Desktop.
Staircase in Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
var n int | |
fmt.Scan(&n) | |
for i := 1; i <= n; i++ { | |
for j := 0; j < n-i; j++ { | |
fmt.Print(" ") | |
} | |
for j := 0; j < n-(n-i); j++ { | |
fmt.Print("#") | |
} | |
fmt.Println() | |
} | |
fmt.Scan(&n) | |
for i := 1; i <= n; i++ { | |
for j := 1; j < n - i; j++ { | |
fmt.Print(" ") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment