Run ID:128417

提交时间:2025-08-16 14:35:48

row,col =input().split() row=int(row) col=int(col) a=[] for x in range(row): b=input().split() a.append(b) res=0 for i in range(row): for j in range(col): if i ==0: res+=int(a[i][j]) elif j==0: res+=int(a[i][j]) elif i==row-1: res+=int(a[i][j]) elif j==col-1: res+=int(a[i][j]) print(res)