daily 2
2023/7/21
daily codeforces
加载过慢请开启缓存,浏览器默认开启
CF 14A
cin >> n >> m;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++){
cin >> str[i][j];
if (str[i][j] == '*') {
if (i <= x1) x1 = i;
if (j <= x2) x2 = j;
if (i >= y1) y1 = i;
if (j >= y2) y2 = j;
}
}
for(int i = x1; i <= y1; i++){
for (int j = x2; j <= y2; j++)
cout << str[i][j];
cout << endl;
}
return 0;