package com.imooc;
public class table {
public static void main(String[] args) {
int myTable[][]={
{12,25,56,48,78,96},
{45,65,78,69,79,63},
{36,46,76,98,26,38}};
int max,main;
int sum=0;
max =myTable[0][0];
main =myTable[0][0];
double avg=0.0;
for(int i=0;i<=3;i++){
for(int j=0;j<=6;j++){
sum=sum+myTable[i][j];
if(max<myTable[i][j])
max=myTable[i][j];
if(main>myTable[i][j])
main=myTable[i][j];
}
}
avg=sum/18;
System.out.println("最大值:"+max);
System.out.println("最小值:"+main);
System.out.println("平均值:"+avg);
}
}
望远
慕的地6079101
Nirva_Troy
ELLIOT4038596
刘小振
qq_小杜_1
相关分类