#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
int n,m;
cin>>n>>m;
string s[m][n];
for(int i=0;i<m;i++)
for(int j=0;j<n;j++)
cin>>s[i][j];
for(int i=0;i<n;i++){
bool tmp=true;
string stmp=s[0][i];
for(int j=0;j<m;j++){
if(s[j][i]!=stmp){tmp=false;break;}
}
if(tmp){
if(i==n-1)cout<<stmp;
else cout<<stmp<<" ";
}
else{
if(i==n-1)cout<<"*";
else cout<<"* ";
}
}
cout<<endl;
return 0;
}
是谷的问题还是代码