| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160818 | 李昱龙 | 单词翻转 | C++ | Accepted | 2 MS | 276 KB | 340 | 2026-09-26 14:42:07 |
#include<bits/stdc++.h> using namespace std; int main(){ string s,s1=" "; getline(cin,s); s=s+s1; int len=s.size(); int k=0; for(int i=0;i<=len-1;i++){ if(s[i]!=' '){ k++; } else if(s[i]==' '){ for(int j=1;j<=k;j++){ cout<<s[i-j]; } k=0; cout<<" "; } } return 0; }