當前位置:編程學習大全網 - 電腦編程 - c語言編程vc6.0從鍵盤輸入 5 行 5 列二維整型數組的數據。計算二維數組中每壹行中的最大值?

c語言編程vc6.0從鍵盤輸入 5 行 5 列二維整型數組的數據。計算二維數組中每壹行中的最大值?

void function(){

int arr[5][5]={0};

int max[5]={0};

for(int i=0;i<5;i++){

for(int j=0;j<5;j++){

scanf("%d",&arr[i][j]);

}

max[i]=getMax(arr[i],5);

}

for(int j=0;j<5;j++){

printf("%d ",max[j]);

}

}

int getMax(int *max,int n){

int temp=max[0];

for(int i=1;i<n;i++){

if(temp<max[i]){

temp=max[i];

}

}

return temp;

}

  • 上一篇:三壹聯合辦學能進三壹嗎? 而且數控專業現在怎麽樣?
  • 下一篇:中國大學MOOC(慕課)網課答案怎麽查?
  • copyright 2024編程學習大全網