Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
100571 | 张永良 | 22数列变换III | C++ | Wrong Answer | 1 MS | 268 KB | 354 | 2024-12-08 13:57:05 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,b=0; cin>>n; int a[n]; for(int i=0;i<=n-1;i++){ cin>>a[i]; } int t,k; cin>>k; for(int m=1;m<=k;m++){ int j; t=a[j-1]; for(int i=j-1;i<=n-2;i++){ a[i]=a[i+1]; } a[n-1]=t; } for(int i=0;i<=n-1;i++){ cout<<a[i]<<" "; } return 0; }
------Input------
10 1 2 3 4 5 6 7 8 9 10 4 4 3 2 5
------Answer-----
1 5 6 7 9 10 4 3 2 8
------Your output-----
5 6 7 8 9 10 0 1 2 3