Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
1650 吴奕希 18插队喝水 C++ Wrong Answer 0 MS 264 KB 418 2023-10-29 07:55:54

Tests(0/10):


Code:

# include<iostream> using namespace std; int main() { int n,m,l,s; cin>>n; int lst[n]; for(int i = 0; i < n; i++) { cin>>lst[i]; } cin>>m; l = lst[n-1]; for(int i = m; i < n; i++) { s = lst[m-1]; lst[m-1] = lst[m]; lst[m] = s; } lst[m-1] = l; for(int i = 0; i < n; i++) { cout<<lst[i]<<" "; } }


Run Info:

------Input------
28 39 3 82 10 45 91 22 88 82 87 30 85 40 68 3 9 1 43 77 90 71 9 60 49 13 94 89 59 18
------Answer-----
39 3 82 10 45 91 22 88 82 87 30 85 40 68 3 9 1 59 43 77 90 71 9 60 49 13 94 89
------Your output-----
39 3 82 10 45 91 22 88 82 87 30 85 40 68 3 9 1 59 77 90 71 9 60 49 13 94 89 59