标签:algo can pat std 循环 for 数组 void 数组元素
#include<cstdio>
#include<malloc.h>
#include<algorithm>
int arr[101];
void Priarr(int a,int b){
if(a<=b)
for(int i=a;i<=b;i++){
if(i!=a)printf(" ");
printf("%d",arr[i]);
}
}
int main(){
int N,M;
scanf("%d%d",&N,&M);
for(int i=1;i<=N;i++){//从1开始存储
scanf("%d",&arr[i]);
}
M%=N;
Priarr(N-M+1,N);
if(N-M+1<N)printf(" ");
Priarr(1,N-M);
return 0;
}
标签:algo can pat std 循环 for 数组 void 数组元素
原文地址:https://www.cnblogs.com/hebust/p/9498136.html