90分求调,看上去没啥大问题
查看原帖
90分求调,看上去没啥大问题
1083573
liulangderenou楼主2024/6/10 17:34

样例应该是过了,但不知道怎么改,把数组调大5之后还是不行,求大佬调一下

#include<bits/stdc++.h>
using namespace std;
int a[10][10]={0},b[10]={0},c[10]={0};
int tag=0;
int main()
{
	for(int i=0;i<5;i++)
	{
		for(int j=0;j<5;j++)
		{
			cin>>a[i][j];
			if(i==0) c[j]=a[i][j];
			if(b[i]<a[i][j]) b[i]=a[i][j];
			if(c[j]>a[i][j]) c[j]=a[i][j];
		}
	}
	for(int k=0;k<5;k++)
	{
		for(int f=0;f<5;f++)
		{
			if(b[k]==c[f])
			{
				cout<<k+1<<" "<<f+1<<" "<<b[k];
				tag=1;
			}
		}
	}
	if(tag=0) cout<<"no";
	return 0;
}

大家浅看一下

2024/6/10 17:34
加载中...