Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
133754 黄枳润 单词翻转 C++ Wrong Answer 1 MS 276 KB 519 2025-10-20 20:42:20

Tests(4/10):


Code:

#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(){ int r=0,l=0; string a; getline(cin,a); for(int i=0;i<a.size();i++){ if(a[i]!=' '){ r++; }else{ for(int j=r-1;j>=l;j--){ cout<<a[j]; }cout<< ' '; r+=1;l+=r; } } for(int j=r-1;j>=l;j--){ cout<<a[j]; } return 0; }


Run Info:

------Input------
Yeah !.
------Answer-----
haeY .!
------Your output-----
haeY