# Untitled

a guest
Dec 2nd, 2019
111
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. n = int(input('Введите количество строк и столбцов матрицы: '))
2. matrix = []
3. m = (n**2)// 2
4. for i in range(n):
5. matrix.append([])
6. for j in range(n):
7. matrix[i].append([])
8. matrix[i][j] = int(input('Введите значение элемента: '))
9. print('Исходная матрица: ')
10. for i in range(n):
11. print(matrix)
12. def conv():
13. saved_matrix = []
14. for i in range(n):
15. saved_matrix.append([])
16. for j in range(n):
17. saved_matrix[i].append([])
18. saved_matrix[i][j]= matrix[i][j]
19. for i in range(n):
20. for j in range(n):
21. matrix[i][j] = matrix[j][i]
22. for j in range(n):
23. matrix[i][j] = saved_matrix[j][i]
24. print('Конвертированная матрица: ')
25. for i in range(n):
26. print(matrix[i])
28. def print_element():
29. i = int(input('Введите строку: '))
30. j = int(input('Введите столбец: '))
31. i = i-1
32. j = j-1
33. print('Элемент:', matrix[i][j])
35. print()