📜  如何使用反向函数在 C++ 中反转字符串 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:54.299000             🧑  作者: Mango

代码示例1
#include 
//The library below must be included for the reverse function to work
#include 
using namespace std;

int main() {
  
  string greeting = "Hello";
  //Note that it takes the iterators to the start and end of the string as arguments
  reverse(greeting.begin(),greeting.end());
  cout<