Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
2386 | 孙浚轩 | 放大的X | C++ | Presentation Error | 17 MS | 248 KB | 779 | 2023-12-30 11:11:29 |
#include<iostream> using namespace std; int main(){ int t,n; cin>>t; for(;t>0;t--){ cin>>n; if(n%2!=0){ for(int i=1,f=1,l=n,delta=0;i<=n;i++){ for(int i1=1;i1<=n;i1++){ if(i1==f||i1==l) cout<<"X"; else cout<<" "; } if(i!=n) cout<<endl; if(f==l) delta=1; if(delta==0){ f++; l--; } else{ f--; l++; } } cout<<endl; } } return 0; }