Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118279 吴梓玄 单词翻转 C++ Accepted 1 MS 264 KB 312 2025-04-26 16:39:54

Tests(10/10):


Code:

#include <bits/stdc++.h> using namespace std; char s[1005]; int main() { gets(s); //reverse(s, s + strlen(s)); s[strlen(s)] = ' '; int l = 0; for(int i = 0; i < strlen(s); ++i) { if(s[i] == ' '){ reverse(s + l, s + i); l = i + 1; } } cout << s << endl; return 0; }