Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
32367 C++|刘一阳 图像模糊处理 C++ 解答错误 0 MS 256 KB 507 2023-11-30 21:28:21

Tests(0/1):


#include<iostream> using namespace std; int m,n; int main() { cin>>m>>n; int a[n+5][m+5],b[n+5][m+5]; for(int i=1;i<=m;i++){ for(int j=1;j<=n;j++){ cin>>a[i][j]; } } for(int i=1;i<=m;i++){ for(int j=1;j<=n;j++){ if(i==1||i==m||j==1||j==n){ b[i][j]=a[i][j]; } else{ 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<=m;i++){ for(int j=1;j<=n;j++){ cout<<a[i][j]<<" "; } cout<<endl; } return 0; }


测评信息: