题目
class Solution {
public int[][] imageSmoother(int[][] ori) {
//行数
int rows=ori.length;
//列数
int cols=ori[0].length;
//新数组
int[][] newArr=new int[rows][cols];
//只有一个元素的情况
if(rows==1&&cols==1) {
newArr[0][0]=ori[0][0];
return newArr;
}
//一维数组的情况
if(cols==1) {
newArr[0][0]=(ori[0][0]+ori[1][0])/2;
newArr[rows-1][0]=(ori[rows-1][0]+ori[rows-2][0])/2;
for(int i=1;i<rows-1;i++) {
newArr[i][0]=(ori[i-1][0]+ori[i+1]