C++字符串反转

it2022-05-05  157

1

#include<iostream> #include<cstring> using namespace std; int main() { char num[]= "abcde" ; strrev(num); cout<<num<<endl; return 0; }

2

#include<algorithm> #include<iostream> #include<cstring> using namespace std; int main() { string num="abcde"; reverse(num.begin(),num.end()); cout<<num<<endl; return 0; }

 


最新回复(0)