分享一个求最大数程序,并输出行和列
#include <stdio.h>int main()
{
int i,j,t,row,colum,a = {2,6,8,7,4,3,9,8,4,14,89,51};
int max = a;
for(i = 0;i < 3;i++)
{
for(j = 0;j <4;j++)
{
if(max < a)
{
max = a,row = i,colum = j;
}
}
}
printf("The max=%d, row=%d, colum=%d\n",max,row,colum);
return 0;
}
页:
[1]