Run ID:77497
提交时间:2024-06-09 19:25:13
row,col = input().split() row=int(row) col=int(col) a=[] for i in range(row): tmp=input().split() tmp=[int(x) for x in tmp] a.append(tmp) res=0 for i in range(row): for j in range (col): if i==0 or i==row-1: res=res+a[i][j] elif j==0 or j==col-1: res=res+a[i][j] print(res)