我水水水水
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
bool is=1;
string re="";
char t;
for(int i=0;i<strs[0].length();i++)
{
for(int j=0;j<strs.size();j++)
{
t=strs[0][i];
if(strs[j][i]==t)
is=1;
else if(i==strs[j].length())
{is=0;
break;}
else
{is=0;break;}
}
if(is==1)
re=re+t;
else
return re;
}
return re;
}
};