Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137572 hjx233 放大的X C++ Accepted 82 MS 268 KB 571 2025-11-20 11:12:06

Tests(1/1):


Code:

#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; }