Run ID:137572

提交时间:2025-11-20 11:12:06

#include <bits/stdc++.h> using namespace std; int main() { int c,i,j,k,n,t; cin>>t; while (t--) { cin>>n; c=i=j=0; while (i<n) { k=0; while (k<j) { cout<<" "; k++; } cout<<"X"; k=c+1; while (k<n-1 and j!=n/2) { cout<<" "; k++; } if (j!=n/2) cout<<"X"; if (j<n/2 and i<=n/2) { j++; c=c+2; } else { j--; c=c-2; } cout<<endl; i++; } cout<<endl; } return 0; }