为什么会RE啊
查看原帖
为什么会RE啊
768396
Yxc123楼主2022/11/14 21:41
#include <iostream>
using namespace std;
const int N=110;
int a[N][N],b[N][N];
int main()
{
	int n,m;
	cin >> n >> m;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
			cin >> a[i][j];
			if(i==1||i==n||j==1||j==m) b[i][j]=a[i][j];
		}
	}
	for(int i=2;i<n;i++)
	{
		for(int j=2;i<m;j++)
		{
			b[i][j]=(a[i][j]+a[i-1][j]+a[i+1][j]+a[i][j-1]+a[i][j+1])/5;
		}
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
			cout << b[i][j] << ' ';
		}
		cout << endl;
	}
	return 0;
}
2022/11/14 21:41
加载中...