当前位置:网站首页>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];
}
}
边栏推荐
- Resolve importerror:lib*** so--cannot open shared object file: No such... (pycharm/clion reports an error but the shell does not)
- Delete soft link
- Simple implementation of database link pool
- JUC 原子累加器
- I set up a blog
- [implementation of depth first search]
- JUC Unsafe
- 【最全面详细解释】背包问题详解
- C language: dynamic memory management
- (dijkstra+ shortest path + edge traversal 0 (m)) acwing 850 Dijkstra finding the shortest path II
猜你喜欢

Solov2 source code analysis

Simulink variant model and variant subsystem usage

BGP 联邦+Community

20211020 academician all drive system

Overview of common layers of image recognition neural network (under update)

Online debugging tool Arthas Foundation

Exploitation of competitive loopholes in attacking and defending world PWN play conditions

C/s model and P2P model

Yolov5 face learning notes

LeetCode 1. Sum of two numbers
随机推荐
20211028 adjustment and tracking
LeetCode 6098. 统计得分小于 K 的子数组数目(前缀和+二分查找)
Tutorial (5.0) 04 Fortint cloud services and scripts * fortiedr * Fortinet network security expert NSE 5
CAS无锁
C language: dynamic memory management
QML(06)——qml. Add a new folder under QRC
C#入门系列(十三) -- 初识结构体
(bfs) acwing 844. Labyrinth
LeetCode 6097. 替换字符后匹配(字典)
(state compression dp+good) acwing 291 Mondrian's dream
C/s model and P2P model
(dp+ memory) acwing 901 skiing
Immutability of shared model
C/S模型与P2P模型
LeetCode 343. 整数拆分
LeetCode 6097. Match after replacing characters (Dictionary)
20220606 Young's inequality for Matrices
LeetCode 583. Deleting two strings
BGP 联邦+Community
Opencv face recognition of ros2 foxy~galactic~humble