有一个 3×4 的矩阵, 要求编程序以求出其中值最大元素及其所在的行号和列号。#include <stdio.h>Void main (){ int i,j,row=0,colum=0,max;Int a3]4]={{1,2,3,4},{9,8,7,6},{-10,10,-5,2}};Max = a0]0];For(i=0; (6); i++)For(j=0; (7); j++)If (ai]j] > max ){Max = ai]j];Row = (8);Colum =(9);}Printf("max=%d, row=%d,Colum=%d\n",max,row,colum);}
发布时间:2024-06-08 22:31:31