C++中algorithm里count()函数 函数原型及描述 count(),存在于vector和string中,分别对单个数字和单个字符计数 用法 string mainString = Let life be beautiful like summer flowers,death like autumn leaves; int total = count(mainString.begin(), mainString.end(), 'u'); cout << this char total is << total << endl; 输出:thi