Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
2453 | 孙浚轩 | 放大的X | C++ | Presentation Error | 17 MS | 264 KB | 667 | 2024-01-06 16:20:04 |
#include<iostream> using namespace std; int main(){ int t,n; cin>>t; for(;t>0;t--){ cin>>n; 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; }