Сделать блок-схему по коду пайтон
import random
A = []
m1 = 1
m2 = 1
diagon1 = 0
diagon2 = 0
m = int(input())
n =int(input())
for i in range(0, m):
A.append([])
for j in range(0, n):
rc = random.randint(0, 100)
A[i].append(rc)
print(A)
if n==m:
for i in range(m):
diagon1 += A[i][i]
m1 *= A[i][i]
for i in range(n):
diagon2 += A[i][n-i-1]
m2 *= A[i][n-i-1]
print("Summarization of all elements in the diagonal from element 0 . 0 to element m . n: ", diagon1)
print("multiplication of all elements of the diagonal from element 0 . 0 to element m . n: ", m1)
print("Summarization of all elements in the diagonal from element 0 . n to element m . 0: ", diagon2)
print("multiplication of all elements of the diagonal from element 0 . n to element m . 0: ", m2)
Ответы
+-------------+
| Start |
+-------------+
|
v
+--------------+
| Import random|
+--------------+
|
v
+--------------+
| Initiate vars|
+--------------+
|
v
+---------------------+
| Loop for each row |
+---------------------+
|
v
+------------------------+
| Loop for each column |
+------------------------+
|
v
+---------------------------+
| Generate random number rc |
+---------------------------+
|
v
+-------------------+
| Add rc to matrix A |
+-------------------+
|
v
+----------------+
| Check if m = n |
+----------------+
|
v
+----------------------+
| Loop through diagonal |
+----------------------+
|
v
+-----------------------------------+
| Calculate sum and product of m1 |
+-----------------------------------+
|
v
+---------------------------+
| Loop through other diagonal |
+---------------------------+
|
v
+-----------------------------------+
| Calculate sum and product of m2 |
+-----------------------------------+
|
v
+-------------------------------------------------+
| Print sum and product of diagonals for matrix A |
+-------------------------------------------------+
|
v
+---------+
| End |
+---------+