c++中字符串反转的3种方法

第一种:使用string.h中的strrev函数ios #include <iostream> #include <cstring> using namespace std; int main() { char s[]="hello"; strrev(s); cout<<s<<endl; return 0; }第二种:使用algorithm中的reverse
相关文章
相关标签/搜索