Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var n int
- fmt.Scanln(&n)
- for i := 0; i < n; i++ {
- currentRow := ""
- for j := 0; j < n * 2; j++ {
- if i != 0 && i != n - 1 && j != 0 && j != n * 2 - 1 {
- currentRow += "/"
- } else {
- currentRow += "*"
- }
- }
- for k := 0; k < n; k++ {
- x := " "
- if (i == n / 2 && n % 2 == 1 ) || ( i + 1 == n / 2 && n % 2 == 0) {
- x = "|"
- }
- currentRow += x
- }
- for j := 0; j < n * 2; j++ {
- if i != 0 && i != n - 1 && j != 0 && j != n * 2 - 1 {
- currentRow += "/"
- } else {
- currentRow += "*"
- }
- }
- fmt.Println(currentRow)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement