Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
68123 | 杨中琦 | 放大的X | C++ | 通过 | 100 | 9 MS | 260 KB | 535 | 2023-02-02 15:29:07 |
#include<bits/stdc++.h> using namespace std; int main(){ int t,n; scanf("%d",&t); int i,j,k; int num; for(i=0;i<t;i++){ scanf("%d",&n); for(j=0;j<n;j++){ num=0; for(k=0;k<n;k++){ if(j==k||j+k==n-1){ printf("X"); num++; if(j==n/2&&k==n/2)num=2; } else if(num!=2)cout<<" "; } cout<<endl; } cout<<endl; } return 0; }