📅  最后修改于: 2022-03-11 14:44:48.545000             🧑  作者: Mango
// Using iterators
for (auto it = s.crbegin() ; it != s.crend(); ++it) {
std::cout << *it;
}
// Naive
for (int i = s.size() - 1; i >= 0; i--) {
std::cout << s[i];
}