Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
102885 小徐老师 18插队喝水 C++ Accepted 1 MS 272 KB 401 2024-12-26 18:30:47

Tests(10/10):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int n; int p; cin>>n; int a[n]; int b[n]; for(int i=0; i<n; ++i) cin>>a[i]; cin>>p; p=p-1; for(int j=0; j<p; ++j) b[j]=a[j]; b[p]=a[n-1]; for(int i=p+1; i<n; ++i) b[i]=a[i-1]; for(int i=0; i<n; ++i) cout<<b[i]<<' '; return 0; }