JiaHeng-DLUT
9/4/2019 - 1:06 PM

字符串反转

#include <iostream>
#include <cstring>
using namespace std;

int main() {
	char s[] = "hello";
	_strrev(s);
	cout << s << endl;	// olleh
	return 0;
}
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	string s = "hello";
	reverse(s.begin(), s.end());
	cout << s << endl;	// olleh
	return 0;
}