daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. matriz1 = []
  2. matriz2 = []
  3. tam = int(input('digite o  tamanho'))
  4.  
  5. #Cria a primeira matriz
  6. for a in range (tam):
  7.     linha = []
  8.     for b in range (tam):
  9.         linha.append(int(input('digite um num')))
  10.     matriz1.append(linha)
  11.  
  12. #Cria uma segunda matriz vazia
  13. for c in range (tam):
  14.     linha = []
  15.     for d in range (tam):
  16.         linha.append(0)
  17.     matriz2.append(linha)
  18.  
  19. #transpoe a primeira matriz para a matriz vazia
  20. for i in range (tam):
  21.     for j in range (tam):
  22.         matriz2[i][j] = matriz1[j][i]
  23.  
  24. #Printa as matrizes
  25. for h in range (tam):
  26.     print(matriz1[h])
  27. print('--------------------')
  28. for z in range (tam):
  29.     print(matriz2[z])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top