#include <iostream>
#include <vector>
int splitWord(const std::string & word )
{
std::vector<std::string> characters;
int num = word.size();
int i = 0;
while(i < num)
{
int size = 1;
if(word[i] & 0x80)
{
char temp = word[i];
temp <<= 1;
do{
temp <<= 1;
++size;
}while(temp & 0x80);
}
std::string subWord;
subWord = word.substr(i, size);
characters.push_back(subWord);
i += size;
}
return characters.size();
}
int main()
{
std::string name;
std::string a = "这是Liferecords编写的C++第1个程序!";
std::cout<< splitWord(a) << "\n";
}