Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 11336

Elementos repetidos em matriz de números inteiros

$
0
0
Matriz = [[1, 2, 3], [4, 5 ,6], [7, 8, 9]] Tamanho_X = 3 Tamanho_Y = 3 x1 = y1 = x2 = y2 = 0 while (x1 >= Tamanho_X) or (y1 >= Tamanho_Y) or (x2 >= Tamahno_X) or (y2 >= Tamanho_Y): x1, y1 = map(int, input("Primeiro: ").split()) x2, y2 = map(int, input("Segundo: ").split()) if matriz[x1][y1] != False: #False/None/-1/.... if matriz[x1][y1] == matriz[x2][y2]: matriz[x1][y1] = False matriz[x2][y2] = False

Viewing all articles
Browse latest Browse all 11336

Trending Articles