C++ 遍历字符串(string)
c++ 中获取字符串的长度可以使用length 或者size#include <iostream>#include <string>using namespace std;int main(){ string a = "hello"; cout<< a.length() <<endl; cout<< a.size() &