当前位置:网站首页>Exercise 8-3 rotate array right

Exercise 8-3 rotate array right

2022-06-13 03:01:00 Python's path to becoming a God

void ArrayShift( int a[], int n, int m ){
	m=m%n;    //m>n The situation of  
	int temp[n],i;
	for(i=0;i<n;i++){
		temp[i]=a[i];
	}
	for(i=0;i<n;i++){   // altogether 2 In this case  
		if(i>=(n-m)){    
			a[i+m-n]=temp[i];
		} else{
			a[i+m]=temp[i];
		}
	}
}

原网站

版权声明
本文为[Python's path to becoming a God]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280535069691.html