//打印空心正方形
int main()
{
int n = 0;
while (cin >> n)
{
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
if (1 == i || i == n )
{
cout << "* "; //*号后有一个空格
}
else if (1 == j || j == n)
{
cout << "* ";
}
else
{
cout << " "; //注意为两个空格
}
}
cout << endl;
}
cout << endl;
}
}