当前位置:网站首页>C language - input array two-dimensional array a from the keyboard, and put 3 in a × 5. The elements in the third column of the matrix are moved to the left to the 0 column, and the element rows in ea
C language - input array two-dimensional array a from the keyboard, and put 3 in a × 5. The elements in the third column of the matrix are moved to the left to the 0 column, and the element rows in ea
2022-07-05 09:16: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");
}
}
边栏推荐
- np. allclose
- scipy.misc.imread()
- NIPS2021 | 超越GraphCL,GNN+对比学习的节点分类新SOTA
- Progressive JPEG pictures and related
- Rebuild my 3D world [open source] [serialization-1]
- Applet data attribute method
- 浅谈Label Smoothing技术
- 2310. The number of bits is the sum of integers of K
- Newton iterative method (solving nonlinear equations)
- Attention is all you need
猜你喜欢
NIPS2021 | 超越GraphCL,GNN+对比学习的节点分类新SOTA
Introduction Guide to stereo vision (7): stereo matching
Kotlin introductory notes (V) classes and objects, inheritance, constructors
Progressive JPEG pictures and related
Summary and Reflection on issues related to seq2seq, attention and transformer in hands-on deep learning
Applet (subcontracting)
顶会论文看图对比学习(GNN+CL)研究趋势
OpenGL - Model Loading
Nodejs modularization
AUTOSAR from getting started to mastering 100 lectures (103) -dbc file format and creation details
随机推荐
Rebuild my 3D world [open source] [serialization-2]
牛顿迭代法(解非线性方程)
[code practice] [stereo matching series] Classic ad census: (5) scan line optimization
RT thread kernel quick start, kernel implementation and application development learning with notes
驾驶证体检医院(114---2 挂对应的医院司机体检)
2309. The best English letters with both upper and lower case
Applet customization component
[code practice] [stereo matching series] Classic ad census: (4) cross domain cost aggregation
c语言指针深入理解
Nodejs modularization
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
Causes and appropriate analysis of possible errors in seq2seq code of "hands on learning in depth"
c#比较两张图像的差异
Jenkins pipeline method (function) definition and call
2311. Longest binary subsequence less than or equal to K
3D reconstruction open source code summary [keep updated]
Talking about label smoothing technology
Using request headers to develop multi terminal applications
. Net service governance flow limiting middleware -fireflysoft RateLimit
Kubedm series-00-overview