当前位置:网站首页>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");
}
}
边栏推荐
- Creation and reference of applet
- 2011-11-21 training record personal training (III)
- Explain NN in pytorch in simple terms CrossEntropyLoss
- 2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition
- Add discount recharge and discount shadow ticket plug-ins to the resource realization applet
- What is a firewall? Explanation of basic knowledge of firewall
- 12. Dynamic link library, DLL
- Causes and appropriate analysis of possible errors in seq2seq code of "hands on learning in depth"
- 2310. The number of bits is the sum of integers of K
- Meta tag details
猜你喜欢

生成对抗网络

编辑器-vi、vim的使用

Progressive JPEG pictures and related

Global configuration tabbar

Composition of applet code
![[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

Confusion matrix

Ros- learn basic knowledge of 0 ROS - nodes, running ROS nodes, topics, services, etc

【ManageEngine】如何利用好OpManager的报表功能

Shutter uses overlay to realize global pop-up
随机推荐
Using request headers to develop multi terminal applications
[code practice] [stereo matching series] Classic ad census: (4) cross domain cost aggregation
C # compare the differences between the two images
云计算技术热点
[code practice] [stereo matching series] Classic ad census: (5) scan line optimization
NIPS2021 | 超越GraphCL,GNN+对比学习的节点分类新SOTA
【ManageEngine】如何利用好OpManager的报表功能
2309. 兼具大小写的最好英文字母
优先级队列(堆)
[code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization
Codeforces Round #648 (Div. 2) E.Maximum Subsequence Value
Applet network data request
Rebuild my 3D world [open source] [serialization-3] [comparison between colmap and openmvg]
顶会论文看图对比学习(GNN+CL)研究趋势
Huber Loss
嗨 FUN 一夏,与 StarRocks 一起玩转 SQL Planner!
Blogger article navigation (classified, real-time update, permanent top)
Use and programming method of ros-8 parameters
3D reconstruction open source code summary [keep updated]
Add discount recharge and discount shadow ticket plug-ins to the resource realization applet