def cria_matriz( num_linhas, num_colunas) :
matriz = [ ]
for i in range ( num_linhas) :
linha = [ ]
for j in range ( num_colunas) :
valor = int ( input ( "Digite o elemento [" + str ( i) + "][" + str ( j) + "]" ) )
linha.append ( valor)
matriz.append ( linha)
return matriz
def le_matriz( ) :
lin = int ( input ( "Digite o numero de linhas da matriz:" ) )
col = int ( input ( "Digite o numero de colunas da matriz: " ) )
return cria_matriz( lin, col)
m = le_matriz( )
for row in m:
for val in row:
print '{:4}' .format ( val) ,
print
ZGVmIGNyaWFfbWF0cml6KG51bV9saW5oYXMsIG51bV9jb2x1bmFzKToKICAgIG1hdHJpeiA9IFtdCiAgICBmb3IgaSBpbiByYW5nZShudW1fbGluaGFzKToKICAgICAgICBsaW5oYSA9IFtdCiAgICAgICAgZm9yIGogaW4gcmFuZ2UobnVtX2NvbHVuYXMpOgogICAgICAgICAgICB2YWxvciA9IGludChpbnB1dCgiRGlnaXRlIG8gZWxlbWVudG8gWyIgKyBzdHIoaSkgKyAiXVsiICsgc3RyKGopICsgIl0iKSkKICAgICAgICAgICAgbGluaGEuYXBwZW5kKHZhbG9yKQogICAgICAgIG1hdHJpei5hcHBlbmQobGluaGEpCiAgICByZXR1cm4gbWF0cml6CgoKZGVmIGxlX21hdHJpeigpOgogICAgbGluID0gaW50KGlucHV0KCJEaWdpdGUgbyBudW1lcm8gZGUgbGluaGFzIGRhIG1hdHJpejoiKSkKICAgIGNvbCA9IGludChpbnB1dCgiRGlnaXRlIG8gbnVtZXJvIGRlIGNvbHVuYXMgZGEgbWF0cml6OiAiKSkKICAgIHJldHVybiBjcmlhX21hdHJpeihsaW4sIGNvbCkKCgptID0gbGVfbWF0cml6KCkKCmZvciByb3cgaW4gbToKICAgIGZvciB2YWwgaW4gcm93OgogICAgICAgIHByaW50ICd7OjR9Jy5mb3JtYXQodmFsKSwKICAgIHByaW50