#include
#include
using namespace std;
int main() {
string s1;
string s2(“hello bite”);
string s3(s2);
//1.for循环
for (size_t i = 0; i < s2.size(); ++i) {
cout << s2[i] << endl;
}
//2.迭代器
auto it = s2.begin();
while (it != s2.end()) {
cout << *it << endl;
++it;
}
//3.范围for
for (auto ch : s2) {
cout << ch << endl;
}
return 0;
}