std::count() 返回给定范围内元素的出现次数。
#include <iostream>
using namespace std;
int main()
{
string str = "abcdeeefsdcexee";
int iCount = count(str.begin(), str.end(), 'e');
cout << iCount << endl;
system("pause");
return 0;
}
std::count() 返回给定范围内元素的出现次数。
#include <iostream>
using namespace std;
int main()
{
string str = "abcdeeefsdcexee";
int iCount = count(str.begin(), str.end(), 'e');
cout << iCount << endl;
system("pause");
return 0;
}