Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
68080 | 安一宸 | 放大的X | C++ | 通过 | 100 | 10 MS | 256 KB | 376 | 2023-02-02 13:52:36 |
#include<bits/stdc++.h> using namespace std; int a,n; char b[100][100]; int main(){ cin>>n; while(n--){ cin>>a; if(a==1){ cout<<"X"<<endl; }else{ for(int i=0;i<a;i++){ for(int j=0;j<a;j++){ if(i==j||i==a-j-1) b[i][j]='X'; else b[i][j]=' '; cout<<b[i][j]; } cout<<endl; } } cout<<endl; } return 0; }