#include<iostream>
#include<string.h>
#include<math.h>
#define maxn 55
using namespace std;
char a[maxn][maxn];
int main()
{
int m,n;
int alt=-1000,ust=1000,sag=-1000,sol=1000;
cin>>m>>n;
int k=0;
for(int i=0;i<m;i++)
for(int j=0;j<n;j++)
{
cin>>a[i][j];
if(a[i][j] == '*')
{
alt=max(alt,i);
ust=min(ust,i);
sag=max(sag,j);
sol=min(sol,j);
}
}
for(int i=ust;i<=alt;i++)
{
for(int j=sol;j<=sag;j++)
{
cout<<a[i][j];
}
cout<<endl;
}
return 0;
}
CodeForces 14A
最新推荐文章于 2022-11-21 22:03:59 发布