1 条题解

  • 1
    @ 2025-7-24 10:44:53
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a,b,c,d,f=0;
    	cin>>a>>b>>c>>d;
    	int e[a][b];
    	for(int i=0;i<a;i++)
    		for(int j=0;j<b;j++)
    			cin>>e[i][j];
    	for(int i=0;i<a;i++)
    		for(int j=0;j<b;j++)
    		{
    			if(i==c-1&&j==d) f+=e[i][j];
    			if(i==c+1&&j==d) f+=e[i][j];
    			if(i==c&&j==d-1) f+=e[i][j];
    			if(i==c&&j==d+1) f+=e[i][j];
    			if(i==c-1&&j==d+1) f+=e[i][j];
    			if(i==c-1&&j==d-1) f+=e[i][j];
    			if(i==c+1&&j==d+1) f+=e[i][j];
    			if(i==c+1&&j==d-1) f+=e[i][j];
    		}
    	cout<<f;
    	return 0;
    }
    
    • 1

    信息

    ID
    291
    时间
    1000ms
    内存
    64MiB
    难度
    9
    标签
    递交数
    35
    已通过
    4
    上传者