当前位置:网站首页>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");
}
}
边栏推荐
- 高性能Spark_transformation性能
- Illustrated network: what is gateway load balancing protocol GLBP?
- Blue Bridge Cup provincial match simulation question 9 (MST)
- Applet data attribute method
- MPSoC QSPI flash upgrade method
- AdaBoost use
- 12. Dynamic link library, DLL
- Configuration and startup of kubedm series-02-kubelet
- The location search property gets the login user name
- 顶会论文看图对比学习(GNN+CL)研究趋势
猜你喜欢
Kotlin introductory notes (VIII) collection and traversal
Applet customization component
Applet (subcontracting)
[technical school] spatial accuracy of binocular stereo vision system: accurate quantitative analysis
Huber Loss
[code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization
Huber Loss
编辑器-vi、vim的使用
一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
Svgo v3.9.0+
随机推荐
Explain NN in pytorch in simple terms CrossEntropyLoss
生成对抗网络
nodejs_ 01_ fs. readFile
基于STM32单片机的测温仪(带人脸检测)
Introduction Guide to stereo vision (7): stereo matching
Mengxin summary of LCs (longest identical subsequence) topics
Uni app implements global variables
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
Ecmascript6 introduction and environment construction
[code practice] [stereo matching series] Classic ad census: (5) scan line optimization
Summary and Reflection on issues related to seq2seq, attention and transformer in hands-on deep learning
一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
嗨 FUN 一夏,与 StarRocks 一起玩转 SQL Planner!
Golang foundation -- map, array and slice store different types of data
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
Kotlin introductory notes (I) kotlin variables and non variables
2309. The best English letters with both upper and lower case
Introduction Guide to stereo vision (1): coordinate system and camera parameters
Summary of "reversal" problem in challenge Programming Competition
Introduction Guide to stereo vision (5): dual camera calibration [no more collection, I charge ~]