C++STL中algorithm里count()函数

lanyue21675 11 0 PDF 2021-01-14 13:01:47

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

用户评论
请输入评论内容
评分:
暂无评论