当前位置:网站首页>C语言-从键盘输入数组二维数组a,将a中3×5矩阵中第3列的元素左移到第0列,第3列以后的每列元素行依次左移,原来左边的各列依次绕到右边
C语言-从键盘输入数组二维数组a,将a中3×5矩阵中第3列的元素左移到第0列,第3列以后的每列元素行依次左移,原来左边的各列依次绕到右边
2022-07-05 09:15:00 【Robbin_mi】
#include <stdio.h>
int main()
{
int a[3][5]={ 1,2,3,4,5,1,2,3,4,5,1,2,3,4,5};
int j,i,b,z,num=0;
for (i = 0; i < 3; i++) {
for (j = 0; j < 5; j++) {
printf("%2d", a[i][j]);
num++;
}
if (num % 5 == 0) printf("\n");
}
printf("--------------------\n");
int a[3][5]={ 1,2,3,4,5,1,2,3,4,5,1,2,3,4,5};
int j,i,b,z,num=0;
for (i = 0; i < 3; i++) {
for (j = 0; j < 2; j++) {
b = a[i][0];
for (z = 1; z < 5; z++) {
a[i][z - 1] = a[i][z];
}
a[i][4] = b;
}
}
for (i = 0; i < 3; i++) {
for (j = 0; j < 5; j++) {
printf("%2d", a[i][j]);
num++;
}
if (num % 5 == 0) printf("\n");
}
}
边栏推荐
- Svgo v3.9.0+
- Talking about label smoothing technology
- 2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition
- Nodemon installation and use
- Introduction Guide to stereo vision (5): dual camera calibration [no more collection, I charge ~]
- Oracle advanced (III) detailed explanation of data dictionary
- 优先级队列(堆)
- Confusion matrix
- 12. Dynamic link library, DLL
- Codeforces Round #648 (Div. 2) E.Maximum Subsequence Value
猜你喜欢

Nodejs modularization

22-07-04 西安 尚好房-项目经验总结(01)
![[technical school] spatial accuracy of binocular stereo vision system: accurate quantitative analysis](/img/59/823b587566f812c76e0e4dee486674.jpg)
[technical school] spatial accuracy of binocular stereo vision system: accurate quantitative analysis

Generate confrontation network

Introduction Guide to stereo vision (1): coordinate system and camera parameters

Node collaboration and publishing

混淆矩阵(Confusion Matrix)

Progressive JPEG pictures and related
![Rebuild my 3D world [open source] [serialization-1]](/img/74/b6253845b43bc18f425d57695fba7c.jpg)
Rebuild my 3D world [open source] [serialization-1]

信息與熵,你想知道的都在這裏了
随机推荐
Global configuration tabbar
Svgo v3.9.0+
Svg optimization by svgo
深入浅出PyTorch中的nn.CrossEntropyLoss
编辑器-vi、vim的使用
. Net service governance flow limiting middleware -fireflysoft RateLimit
OpenGL - Model Loading
【PyTorch Bug】RuntimeError: Boolean value of Tensor with more than one value is ambiguous
Codeworks round 638 (Div. 2) cute new problem solution
牛顿迭代法(解非线性方程)
混淆矩阵(Confusion Matrix)
Transfer learning and domain adaptation
Install the CPU version of tensorflow+cuda+cudnn (ultra detailed)
Introduction Guide to stereo vision (1): coordinate system and camera parameters
交通运输部、教育部:广泛开展水上交通安全宣传和防溺水安全提醒
Introduction Guide to stereo vision (2): key matrix (essential matrix, basic matrix, homography matrix)
Ministry of transport and Ministry of Education: widely carry out water traffic safety publicity and drowning prevention safety reminders
2311. Longest binary subsequence less than or equal to K
Golang foundation - the time data inserted by golang into MySQL is inconsistent with the local time
一文详解图对比学习(GNN+CL)的一般流程和最新研究趋势