北京大学《计算概论》课件:ch4-c语言编程应用
第十四讲: C语言编程应用;二维数组回形遍历;#include “stdio.h”
#define ROW 100
#define COL 100
int main(){
int row, col, matrix[ROW][COL];
int i, j;
scanf(“%d %d”, row, col);
for(i = 0; i row; i++){
for(j = 0; j col; j++){
scanf(“%d”, (matrix[i][j]));
}
}
return 0;
};01;01;a;a; 请一位同学 在黑板上写下程序:
按照图中的顺序输出圈上的元素
(从左上角开始);for(j = xx_col; j sx_col; j++){
printf(“%d\n”, matrix[xx_row][j]);
}
for(i = xx_row; i sx_row; i++){
printf(“%d\n”, matrix[i][sx_col]);
}
for(j = sx_col; j xx_col; j--){
printf(“%d\n”, matrix[sx_row][j]);
}
for(i = sx_row; i xx_row; i--){
printf(“%d\n”, matrix[i][xx_col]);
}
您可能关注的文档
- 刘亚平 专业英语 the study of adinistration.ppt
- 刘义林博士-综积极情绪疗法9.ppt
- 刘亚平 专业英语 toward a nw public administration.ppt
- 刘亚平 专业英语 刘亚平 专业英语(第九周)ederalism, igr and intergovernmental management.ppt
- 刘亚平 专业英语 刘亚平 专业英语(第七周)ower and adminisration.ppt
- 刘亚平 专业英语 刘亚平 专业英语(第六周)toward a feminist perspective i public administration theory.ppt
- 刘亚平 专业英语 刘亚平 专业英语(第十四周)doing institutional anlysis.ppt
- 刘义林博士-综合极情绪疗法10.ppt
- 刘亚平 专业英语 刘亚平 专业英语(第周)bureaucratic structure and personality.ppt
- 刘亚平 专英语 刘亚平 专业英语.ppt
- 全文可编辑培训课件-机构研究报告-德国数字音乐用户分析报告:deezer -外文培训课件.pptx
- 全文可编辑培训课件-机构研究报告-德国退休用户分析报告-外文培训课件.pptx
- 全文可编辑培训课件-机构研究报告-德国洗衣机用户分析报告:candy -外文培训课件.pptx
- 全文可编辑培训课件-机构研究报告-德国新闻日报用户分析报告:koelner stadt anzeiger-外文培训课件.pptx
- 全文可编辑培训课件-机构研究报告-德国新闻日报用户分析报告:westdeutsche allgemeine zeitung leserinnen -外文培训课件.pptx
- 全文可编辑培训课件-机构研究报告-德国移动运营商用户(联通)分析报告:alditalk -外文培训课件.pptx
- 全文可编辑培训课件-机构研究报告-德国移动运营商用户(联通,电信)分析报告:alditalk -外文培训课件.pptx
- 全文可编辑培训课件-机构研究报告-德国数字音乐用户分析报告:apple music itunes -外文培训课件.pptx
- 全文可编辑培训课件-机构研究报告-德国洗衣机用户分析报告:beko -外文培训课件.pptx
- 全文可编辑培训课件-机构研究报告-德国洗衣机用户分析报告:miele -外文培训课件.pptx
原创力文档

文档评论(0)