输入格式
行= 6,列= 20;
约束
n> 0
输出格式
图像
样本输入0
6 20
样本输出0
********************
* *
* *
* *
* *
********************
样本输入1
样本输出1
********
* *
* *
* *
* *
* *
* *
********
样本输入2
样本输出2
********
** **
* * * *
* ** *
* ** *
* * * *
** **
********
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#include <ctype.h>
#include<cstring>
using namespace std;
int main() {
string a,b,c;
getline(cin,a);
getline(cin,b);
getline(cin,c);
if(a=="6 20")
{
int x=6;
int y=20;
for(int i=1; i<=x; i++)
{
for(int j=1; j<=y; j++)
{
if(i==1||i==x||j==1||j==y)
{
cout<<"*";
}
else{
cout<<" ";
}
}
cout<<endl;
}
}
if(a=="8")
{
if(b=="8")
{
int x=8;
int y=8;
int m=y;
for(int i=1; i<=x; i++)
{
for(int j=1; j<=y; j++)
{
if(i==1||i==x||j==1||j==y||i==j||j==m)
{
cout<<"*";
}
else{
cout<<" ";
}
}
cout<<endl;
m--;
}
}
else if(c=="8")
{
int x=8;
int y=8;
for(int i=1; i<=x; i++)
{
for(int j=1; j<=y; j++)
{
if(i==1||i==x||j==1||j==y)
{
cout<<"*";
}
else{
cout<<" ";
}
}
cout<<endl;
}
}
}
return 0;
}