Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152847 黄俊然 单词翻转 C++ Wrong Answer 1 MS 272 KB 532 2026-05-03 15:10:39

Tests(0/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(){ string s; int n; getline(cin,s); for(int i=1;i<s.size();i++){ if(s[i]==' ' && s[i+1]!=' '){ n=i; for(int j=0;j<n;j++){ cout<<s[n-j-1]; } cout<<" "; } } return 0; }


Run Info:

------Input------
123 45
------Answer-----
321 54
------Your output-----
321