| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 123410 | 冯诚阳 | 单词翻转 | C++ | Wrong Answer | 1 MS | 272 KB | 702 | 2025-06-29 18:55:30 |
#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 a; getline(cin,a); int l=a.size(),n=0; for(int i=0;i<l;i++){ if(a[i]!=' ') n++; if(a[i]==' ' || i==l-1){ if(i==l-1&&a[i]!=' ') cout<<a[i]; for(int j=i-1;j>=i-n;j--) cout<<a[j]; if(i!=l-1) cout<<a[i]; n=0; } } if(a[l-1]==' ') cout<<' '; return 0; }
------Input------
12345
------Answer-----
54321
------Your output-----
54321