当前位置:网站首页>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");
}
}
边栏推荐
- Confusion matrix
- Applet (global data sharing)
- Array, date, string object method
- Solution to the problems of the 17th Zhejiang University City College Program Design Competition (synchronized competition)
- Wechat H5 official account to get openid climbing account
- Multiple linear regression (sklearn method)
- Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
- Understanding rotation matrix R from the perspective of base transformation
- [technical school] spatial accuracy of binocular stereo vision system: accurate quantitative analysis
- 2011-11-21 training record personal training (III)
猜你喜欢
![[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

Applet data attribute method

Install the CPU version of tensorflow+cuda+cudnn (ultra detailed)

一文详解图对比学习(GNN+CL)的一般流程和最新研究趋势

Ros-11 common visualization tools
![Rebuild my 3D world [open source] [serialization-2]](/img/e6/aad5f432aca619b992753187729dcf.jpg)
Rebuild my 3D world [open source] [serialization-2]

AUTOSAR从入门到精通100讲(103)-dbc文件的格式以及创建详解
![[code practice] [stereo matching series] Classic ad census: (5) scan line optimization](/img/54/cb1373fbe7b21c5383580e8b638a2c.jpg)
[code practice] [stereo matching series] Classic ad census: (5) scan line optimization

Introduction Guide to stereo vision (2): key matrix (essential matrix, basic matrix, homography matrix)

OpenGL - Coordinate Systems
随机推荐
Ecmascript6 introduction and environment construction
Confusion matrix
深入浅出PyTorch中的nn.CrossEntropyLoss
[beauty of algebra] solution method of linear equations ax=0
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
太不好用了,长文章加图文,今后只写小短文
nodejs_ 01_ fs. readFile
Ministry of transport and Ministry of Education: widely carry out water traffic safety publicity and drowning prevention safety reminders
Progressive JPEG pictures and related
Kotlin introductory notes (III) kotlin program logic control (if, when)
OpenGL - Model Loading
Causes and appropriate analysis of possible errors in seq2seq code of "hands on learning in depth"
Introduction Guide to stereo vision (6): level constraints and polar correction of fusiello method
Kotlin introductory notes (II) a brief introduction to kotlin functions
一文详解图对比学习(GNN+CL)的一般流程和最新研究趋势
信息與熵,你想知道的都在這裏了
2310. 个位数字为 K 的整数之和
[ctfhub] Title cookie:hello guest only admin can get flag. (cookie spoofing, authentication, forgery)
Kotlin introductory notes (V) classes and objects, inheritance, constructors
Wxss template syntax