Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137571 hjx233 放大的X C++ Presentation Error 79 MS 272 KB 556 2025-11-20 11:10:23

Tests(0/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++; } } return 0; }