STL 有一个函数 reverse,他可以实现对数组的翻转。
reverse
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; reverse(s.begin(),s.end()); cout<<s; }
暂无评论