| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 152855 | 唐诗阳 | 单词翻转 | C++ | Wrong Answer | 0 MS | 272 KB | 630 | 2026-05-03 15:25:24 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ string s; int n=0; getline(cin,s); for(int i=0;i<s.size();i++){ if(s[i]==' ' && s[i+1]!=' ' && i!=s.size()-1){ for(int j=i-1;j>=n;j--) cout<<s[j]; cout<<' '; n=i; } else if(i==s.size()-1) for(int j=i-1;j>=n;j--) cout<<s[j]; } return 0; }
------Input------
123 45
------Answer-----
321 54
------Your output-----
321 4