关于 string iterators imcompatiable问题 能编译 运行出错 求大大指点

#include
#include
#include
#include
#include
using namespace std;
struct com{
bool operator()(const string &s1, const string &s2){
int c1 = count(s1.begin(), s2.end(), '1');
int c2 = count(s2.begin(), s2.end(), '1');
if (c1 != c2)return c1 < c2;
return c1 < c2;
}
};

int main(){
ifstream cin("d://aaa.txt");
if (!cin){
cout << "无法打开文件" << endl;
}
string s;
multiset ms;
multiset::iterator it;

while (cin >> s){
    ms.insert(s);
}   
for (it = ms.begin(); it != ms.end(); it++){        
    cout << (*it) << endl;
}
system("pause");

}
图片说明


你ms类型是什么,应该是这样的吧

 multiset<string> ms

找到 答案了 int c1=count(s1.begin(),s1.end(),'1'); s2应改为 s1