Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
68105 | 董承诺 | 放大的X | C++ | 通过 | 100 | 9 MS | 256 KB | 516 | 2023-02-02 14:49:48 |
#include <bits/stdc++.h> using namespace std; int a,b; int main(){ cin>>b; while(b--){ cin>>a; for(int i=1;i<=a/2;i++){ for(int j=1;j<i;j++) cout<<" "; cout<<"X"; for(int j=1;j<=a-2*i;j++) cout<<" "; cout<<"X"; cout<<endl; } for(int i=1;i<=a/2;i++) cout<<" "; cout<<"X"; cout<<endl; for(int i=a/2;i>=1;i--){ for(int j=1;j<i;j++) cout<<" "; cout<<"X"; for(int j=1;j<=a-2*i;j++)cout<<" "; cout<<"X"; cout<<endl; } cout<<endl; } return 0; }