字符串反转
字符串反转
http://www.nowcoder.com/questionTerminal/e45e078701ab4e4cb49393ae30f1bb04
#include <iostream> #include <stdio.h> #include <vector> using namespace std; int main() { int ch; vector<char> vec; while((ch=getchar())&& ch != '\n') { vec.push_back(ch); } while(!vec.empty()) { printf("%c",vec.back()); vec.pop_back(); } return 0; }