P
P
pwN112014-07-08 23:48:50
C++ / C#
pwN11, 2014-07-08 23:48:50

How to build a flowchart for this program?

Help with building block diagram. Here is the program in C# console

int n;
                n = int.Parse(Console.ReadLine());
            int[,] mas = new int[9, n];
    
            // заполнение массива
            Random Gen= new Random();
            for (int i=0; i < mas.GetLength(0); i++)
            {
                for (int j=0; j < mas.GetLength(1); j++)
                {
                    mas[i, j] = Gen.Next(1, 10);
                }
            }
    
            int [] sum = new int[mas.GetLength(0)];
    
            // подсчет столбцов
 
            for (int i = 0; i < mas.GetLength(0); i++)
            {
                sum[i] = 0;
                for (int j = 0; j < mas.GetLength(1); j++)
                {
                    sum[i] += mas[i, j];
                    Console.WriteLine(mas[i, j]);
                }
                
                Console.WriteLine("Среднее значение " + i.ToString() + "-го столбца = " + sum[i]/9);

            } Console.Read();

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-07-08
@pwN11

conditions are diamonds, actions are squares. The for loop is a square at the beginning, then a diamond, then a square again. In theory, if you have several actions in a row, you can combine them in one box. Connect with arrows - you're done.

T
Tsiren Naimanov, 2014-08-03
@ImmortalCAT


is it difficult?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question