文章
1
粉丝
165
获赞
0
访问
8.2k
#include<stdio.h>
#include<malloc.h>
int main() {
int m, n, index,temp;
scanf("%d %d", &n, &m);
if (m > n) {
index = m % n;
}
else {
index = m;
}
int* a = (int*)malloc(n * sizeof(int*));
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (int i = 0; i < index; i++) {
temp = a[0];
for (int j = 0; j < n-1; j++) {
a[j] = a[j + 1];
}
a[n - 1] = temp;
}
for (int i =...
登录后发布评论
暂无评论,来抢沙发