string str="hello"; 1.通过 []访问单个字符 for(int i=0;i<str.size();i++) cout<<str[i]; 2.通过 at访问单个字符 for(int i=0;i<str.size();i++) cout<<str.at(i);