题解 | #反序输出#
反序输出
https://www.nowcoder.com/practice/171278d170c64d998ab342b3b40171bb
#include <iostream> using namespace std; void reverse(string s) { for(int i=0;i<s.length()/2;i++) { char c=s[i]; s[i]=s[s.length()-1-i]; s[s.length()-1-i]=c; } cout<<s<<endl; } int main() { string s; while(cin>>s)reverse(s); } // 64 位输出请用 printf("%lld")