Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
42550 惠子铭 图像模糊处理 C++ 通过 1 MS 252 KB 418 2024-03-01 15:52:55

Tests(1/1):


#include<iostream> using namespace std; int a[100][100]; int main() { int m,n; cin>>m>>n; for(int i=0;i<m;i++){ for(int j=0;j<n;j++){ cin>>a[i][j]; } } for(int i=0;i<m;i++){ for(int j=0;j<n;j++){ if(i!=0&&i!=m-1&&j!=0&&j!=n-1){ cout<<int((a[i+1][j]+a[i-1][j]+a[i][j-1]+a[i][j+1]+a[i][j])/5)<<" "; } else{ cout<<a[i][j]<<" "; } } cout<<endl; } return 0; }


测评信息: