| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 156252 | 李昱龙 | 单词翻转 | C++ | Accepted | 1 MS | 284 KB | 397 | 2026-06-27 15:08:30 |
#include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin,s); 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<<" "; } if(i==len-1){ for(int j=0;j<k;j++){ cout<<s[i-j]; } } } return 0; }