Run ID:69050

提交时间:2024-03-30 12:24:28

row,col = input().split() #5,4 --->'5', '4' 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): #i是行号 for j in range(col): #j是列号 a[i][j] 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)