📄 ch27-1.c
字号:
#define N 20
#define M 20
#include<stdio.h>
#include<conio.h>
void main( )
{
int a[N][M]; /*int a[][]; not allowed here */
int i,j,k,row,col,n,m,find=0;
clrscr();
printf("\nEnter n & m:\n\n");
scanf("%d%d",&n,&m);
printf("\nEnter a[0][0]--a[%d][%d]\n\n",n-1,m-1);
for(i=0;i<n;i++)
for(j=0;j<m;j++)
scanf("%d",&a[i][j]);
printf("\n\nThe array you have just entered is:\n");
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
printf("%5d",a[i][j]);
printf("\n\n");
}
/*find the point */
for(i=0;i<n;i++)
{
for(col=0,j=1;j<m;j++)
if(a[i][col]<a[i][j]) /*find col,select sort according to col*/
col=j;
for(row=0,k=1;k<n;k++)
if(a[row][col]>a[k][col]) /*find row,select sort according to row*/
row=k;
if(i==row)
{
find=1;
printf("The point is a[%d][%d].\n",row,col);
}
}
if(!find)
printf("\nNo solution.\n");
getch();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -