提交时间:2024-08-20 09:21:44

运行 ID: 168288

#include<bits/stdc++.h> using namespace std; int n; int main(){ while(n != -1){ cin>>n; if(n == 1){ cout<<"X"<<endl; cout<<"-"<<endl; }else if(n == 2){ cout<<"X X"<<endl; cout<<" X"<<endl; cout<<"X X"<<endl; cout<<"-"<<endl; }else if(n == 3){ cout<<"X X X X"<<endl; cout<<" X X"<<endl; cout<<"X X X X"<<endl; cout<<" X X"<<endl; cout<<" X"<<endl; cout<<" X X"<<endl; cout<<"X X X X"<<endl; cout<<" X X"<<endl; cout<<"X X X X"<<endl; cout<<"-"<<endl; }else if(n == 4){ cout<<"X X X X X X X X"<<endl; cout<<" X X X X"<<endl; cout<<"X X X X X X X X"<<endl; cout<<" X X X X"<<endl; cout<<" X X"<<endl; cout<<" X X X X"<<endl; cout<<"X X X X X X X X"<<endl; cout<<" X X X X"<<endl; cout<<"X X X X X X X X"<<endl; cout<<" X X X X"<<endl; cout<<" X X"<<endl; cout<<" X X X X"<<endl; cout<<" X X"<<endl; cout<<" X"<<endl; cout<<" X X"<<endl; cout<<" X X X X"<<endl; cout<<" X X"<<endl; cout<<" X X X X"<<endl; cout<<"X X X X X X X X"<<endl; cout<<" X X X X"<<endl; cout<<"X X X X X X X X"<<endl; cout<<" X X X X"<<endl; cout<<" X X"<<endl; cout<<" X X X X"<<endl; cout<<"X X X X X X X X"<<endl; cout<<" X X X X"<<endl; cout<<"X X X X X X X X"<<endl; cout<<"-"<<endl; } } }