#include<iostream>
using namespace std;
int main()
{
int w,h,i,j;
while(cin>>w>>h)
{
for(j=0;j<h+2;j++)
{
if(j==0||j==h+1)
{
for(i=0;i<w+2;i++)
{
if(i==0)
cout<<'+';
else if(i==w+1)
cout<<'+'<<endl;
else
cout<<'-';
}
}
else
for(i=0;i<w+2;i++)
{
if(i==0)
cout<<'|';
else if(i==w+1)
cout<<'|'<<endl;
else
cout<<' ';
}
}
cout<<endl;
}
return 0;
}
杭电ACM2052C++
最新推荐文章于 2021-03-12 10:34:45 发布