Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159451 Kevin 单词翻转 C++ Wrong Answer 1 MS 264 KB 427 2026-08-31 15:30:37

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; char a[1005]; int main(){ int tou=0,wei=0,chang=0; cin.getline(a,1005); int len=strlen(a); for(int i=0;i<len;i++){ wei++; if(a[i]!=' '){ if(chang==0){ tou=i; } chang++; } else{ for(int j=wei-2;j>=tou;j--){ cout<<a[j]; } cout<<a[i]; chang=0; } } for(int j=wei-2;j>=tou-1;j--){ cout<<a[j]; } return 0; }


Run Info:

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