需要添加5个“ @”符号。每个角落4个,中间一个

因此,程序可以制作出我需要制作的形状。但是我似乎无法弄清楚代码中将其打印出@的位置。

public static void main(String[] args)
{
  int n = 9;
  for(int row = 0; row < n ; row++)
  {
     for(int col = 0; col < n ; col++)
     {
     if(row == 0 || col == 0 || row ==  n - 1 || col == n - 1) 
        System.out.print("*");
     else if(row + col == n - 1 || row == col)
        System.out.print("+");
     else
        System.out.print(" ");
     }
        System.out.println();
    }
  }
}