
#include<iostream>
using namespace std;
int main()
{
int n,a;
cin>>n;
while(n--)
{ cin>>a;
for(int b=0;b<a;b++)
{
for(int c=0;c<a;c++)
{
if(b==c||b==a-c-1) cout<<"X";
else cout<<" ";
}
cout<<'\n';
}
cout<<'\n';
}
return 0;
}


错误示例显示空格符多了 那这个if里面的else语句应该怎么改 才能让中间的X输出完就直接换行而不是空格在换行