当前位置:网站首页>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");
}
}
边栏推荐
- Applet global style configuration window
- Ros-10 roslaunch summary
- notepad++
- Pearson correlation coefficient
- 信息与熵,你想知道的都在这里了
- 2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition
- It's too difficult to use. Long articles plus pictures and texts will only be written in short articles in the future
- Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
- ROS learning 1- create workspaces and function packs
- Kotlin introductory notes (I) kotlin variables and non variables
猜你喜欢

Applet global style configuration window

优先级队列(堆)

Install the CPU version of tensorflow+cuda+cudnn (ultra detailed)
![[beauty of algebra] singular value decomposition (SVD) and its application to linear least squares solution ax=b](/img/ee/8e07e2dd89bed63ff44400fe1864a9.jpg)
[beauty of algebra] singular value decomposition (SVD) and its application to linear least squares solution ax=b
![[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

Composition of applet code

混淆矩阵(Confusion Matrix)
![[code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization](/img/54/cb1373fbe7b21c5383580e8b638a2c.jpg)
[code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization

Wxss template syntax

Applet customization component
随机推荐
浅谈Label Smoothing技术
Applet customization component
【ManageEngine】如何利用好OpManager的报表功能
Creation and reference of applet
Applet data attribute method
交通运输部、教育部:广泛开展水上交通安全宣传和防溺水安全提醒
Rebuild my 3D world [open source] [serialization-3] [comparison between colmap and openmvg]
Applet network data request
Nodemon installation and use
高性能Spark_transformation性能
Talking about label smoothing technology
什么是防火墙?防火墙基础知识讲解
2309. 兼具大小写的最好英文字母
What is a firewall? Explanation of basic knowledge of firewall
12. Dynamic link library, DLL
Configuration and startup of kubedm series-02-kubelet
牛顿迭代法(解非线性方程)
Programming implementation of ROS learning 6 -service node
2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition
Alibaba cloud sends SMS verification code