当前位置:网站首页>Exercise 8-3 rotate the array to the right (20 points)
Exercise 8-3 rotate the array to the right (20 points)
2022-06-13 09:25:00 【Hezeze】

int ArrayShift( int a[], int n, int m )
{
int i;
m=m%n;
int temp[n];
for (i=0;i<m;i++) {
temp[i]=a[n-m+i];
}
for (i=n-1;i>=m;i--) {
a[i]=a[i-m];
}
for (i=0;i<m;i++) {
a[i]=temp[i];
}
}
边栏推荐
- JUC atomic array
- C#入门系列(十三) -- 初识结构体
- ROS2之OpenCV人脸识别foxy~galactic~humble
- LeetCode 6095. Strong password checker II
- 线上调试工具Arthas基础
- Alibaba senior experts analyze the standard design of protocol
- JUC atomic integer
- LeetCode 5270. Minimum path cost in grid (dynamic programming)
- (tree DP) acwing 285 A dance without a boss
- 20211108 differential tracker
猜你喜欢

SQL ROW_ The number() function uses

【pytorch环境安装搭建】

CAS NO lock

Tutorial (5.0) 04 Fortint cloud services and scripts * fortiedr * Fortinet network security expert NSE 5

Cisco, Huawei network equipment

Alibaba senior experts analyze the standard design of protocol

(dijkstra+ shortest path + edge traversal 0 (m)) acwing 850 Dijkstra finding the shortest path II

攻防世界PWN play 条件竞争漏洞的利用

BGP 联邦+Community

(dfs+ pruning + checkerboard problem +dood) acwing 843 N-queen problem
随机推荐
I set up a blog
【最全面详细解释】背包问题详解
(state compression dp+good) acwing 291 Mondrian's dream
线上调试工具Arthas基础
Online debugging tool Arthas Foundation
Sort() sort function
Online debugging tool Arthas advanced
Use typescript to complete simple snake eating function
LeetCode 72. Edit distance
20220524 how to install coppeliasim to disk D
I have summarized the knowledge points of JS [intermediate and advanced] for you
C language: recursive function to realize Hanoi Tower
[implementation of depth first search]
LeetCode 1. Sum of two numbers
【pytorch环境安装搭建】
QML(06)——qml. Add a new folder under QRC
LeetCode 583. 两个字符串的删除操作
Musk's "meta universe" dream
Storage mode of drawings
Solov2 nanny level tutorial (including environment configuration, training your own data set, code logic analysis, etc...) Updating ing