/*Finding the two arrys's max and sum*/
#include<stdio.h>
#include<stdlib.h>
int main() {
int arrys[2][3],sum=0,max,x,y;
printf("Please put the arrys:\n");
for(x=0; x<2; x++)
for(y=0; y<3; y++)
scanf("%d",&arrys[x][y]);
for(x=0; x<2; x++)//Finding the max and calculatting the sum//
for(y=0; y<3; y++) {
if(max<arrys[x][y])
max=arrys[x][y];
sum=sum+arrys[x][y];
}
printf("max=%d sum=%x\n",max,sum);//output format//
system("pause");
return 0;
}
C语言求二维数组的和及最大值
原创
©著作权归作者所有:来自51CTO博客作者好好学好好看的原创作品,请联系作者获取转载授权,否则将追究法律责任
欢迎指出代码的不足之处,我很高兴你能指出我的错误。
上一篇:C语言-选择排序
下一篇:C语言-输出矩阵对角线之和
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Java 中数组的使用(一维数组和二维数组)
本文详细的介绍了,在Java 中数组的使用,并对其内存存在形式进行了详细的分析。
数组 一维数组 二维数组 java基础 -
一维和二维数组sizeof和strlen的区别
sizeof和strlen的区别
bc 一维数组 二维数组 -
python求二维数组最大值
python求二维数组最大值
numpy python 二维数组 -
C经典 求二维数组的最大值与行,还有列
[3] = { {67,89,90}, {80,90,80}, {59,43,78}, {99,68,98}, {56,89,67}
二维数组 c语言 #include 数组最大值 数组