| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160262 | 邓弘锐 | 单词翻转 | C++ | Wrong Answer | 1 MS | 272 KB | 328 | 2026-09-13 15:30:41 |
#include<bits/stdc++.h> using namespace std; string s; int main(){ getline(cin,s); int len=s.size(); int cnt=0; for(int i=0;i<len;i++){ if(s[i]!=' '){ cnt++; } else if(s[i]==' '){ for(int j=1;j<=cnt;j++){ cout<<s[i-j]; } cout<<" "; cnt=0; } } return 0; }
------Input------
123 45
------Answer-----
321 54
------Your output-----
321