C++翻转字符串
#include<iostream> #include<string> using namespace std; int man(){ string s; cout<<"Type something...\n"; getline(cin,s); string::iterator pos; for(pos=s.end();pos!=s.begin()-1;pos){ out<<*pos; }
C++翻转字符串
#include<iostream> #include<string> using namespace std; int man(){ string s; cout<<"Type something...\n"; getline(cin,s); string::iterator pos; for(pos=s.end();pos!=s.begin()-1;pos){ out<<*pos; }