当前位置:网站首页>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");
}
}
边栏推荐
- 2311. Longest binary subsequence less than or equal to K
- NIPS2021 | 超越GraphCL,GNN+对比学习的节点分类新SOTA
- 一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
- Applet (subcontracting)
- Introduction Guide to stereo vision (2): key matrix (essential matrix, basic matrix, homography matrix)
- L'information et l'entropie, tout ce que vous voulez savoir est ici.
- Node collaboration and publishing
- 交通运输部、教育部:广泛开展水上交通安全宣传和防溺水安全提醒
- 2311. 小于等于 K 的最长二进制子序列
- Nodejs modularization
猜你喜欢

Wxml template syntax
![Rebuild my 3D world [open source] [serialization-2]](/img/e6/aad5f432aca619b992753187729dcf.jpg)
Rebuild my 3D world [open source] [serialization-2]

The combination of deep learning model and wet experiment is expected to be used for metabolic flux analysis

Priority queue (heap)

利用请求头开发多端应用

OpenGL - Model Loading

AUTOSAR从入门到精通100讲(103)-dbc文件的格式以及创建详解

2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition

【阅读笔记】图对比学习 GNN+CL

信息與熵,你想知道的都在這裏了
随机推荐
Node collaboration and publishing
[beauty of algebra] singular value decomposition (SVD) and its application to linear least squares solution ax=b
生成对抗网络
Composition of applet code
顶会论文看图对比学习(GNN+CL)研究趋势
Introduction Guide to stereo vision (5): dual camera calibration [no more collection, I charge ~]
Driver's license physical examination hospital (114-2 hang up the corresponding hospital driver physical examination)
深入浅出PyTorch中的nn.CrossEntropyLoss
Svg optimization by svgo
Creation and reference of applet
Multiple linear regression (gradient descent method)
Kotlin introductory notes (IV) circular statements (simple explanation of while, for)
信息与熵,你想知道的都在这里了
3D reconstruction open source code summary [keep updated]
Meta tag details
牛顿迭代法(解非线性方程)
Causes and appropriate analysis of possible errors in seq2seq code of "hands on learning in depth"
File server migration scheme of a company
It's too difficult to use. Long articles plus pictures and texts will only be written in short articles in the future
Multiple linear regression (sklearn method)