Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
32342 jiabokai 图像模糊处理 C++ 解答错误 0 MS 252 KB 400 2023-11-30 20:55:34

Tests(0/1):


#include<iostream> using namespace std; int main(){ int n,m; cin>>n>>m; int a[n][m]; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin>>a[i][j]; } } for(int i=1;i<n-1;i++){ for(int j=1;j<m-1;j++){ int cnt=a[i][j]+a[i+1][j]+a[i-1][j]+a[i][j+1]+a[i][j-1]; a[i][j]=cnt; } } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cout<<a[i][j]; } } return 0; }


测评信息:

输入

4 5
100 0 100 0 50
50 100 200 0 0
50 50 100 100 200
100 100 50 50 100

输出

100010005050400800900050700175030002001001005050100

答案

100 0 100 0 50
50 80 100 60 0
50 80 100 90 200
100 100 50 50 100

系统信息

exit code: 0, checker exit code: 0