2 条题解
-
0
string
类属于STL,可以用reverse
和begin()
、end()
函数 另外stringstream用在此处也很方便#include <iostream> #include <cstring> #include <algorithm> #include <sstream> using namespace std; string str, out, temp; int main() { getline(cin, str); stringstream ssin(str); while(ssin >> temp) { reverse(temp.begin(), temp.end()); out += temp; out += ' '; } cout << out << endl; return 0; }
- 1
信息
- ID
- 134
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 6
- 标签
- (无)
- 递交数
- 114
- 已通过
- 34
- 上传者