Dan two-dimensional. Examples of solving problems with two-dimensional arrays, tasks for self-decisions

The next portion of tasks on computer science for schoolchildren arrived. This time we look at work with two-dimensional arrays on C ++. These tasks are interesting enough. And I liked most of them.

Task number 1.

Find the indexes of the first entry of the maximum element.
Input data format
The program receives the size of an array N and M to input, then N rows by M numbers each. N and M do not exceed 100.
Output format
Display two numbers: Row number and column number, in which the largest element is in the two-dimensional array. If there are several such elements, one that has fewer line number, and if row numbers are equal to the one that has less column number.

Sample Input: 3 4 0 3 2 4 2 3 5 5 5 1 2 3 SAMPLE OUTPUT: 1 2

#Include. Using Namespace STD; int Main () (int n, m; cin \u003e\u003e n \u003e\u003e m; int a; // reading for (int i \u003d 0; i< n; i++) { for (int j = 0; j < m; j++) { cin >\u003e A [I] [J]; )) int max \u003d a, max_i \u003d 0, max_j \u003d 0; for (int i \u003d 0; i< n; i++) { for (int j = 0; j < m; j++) { if (a[i][j] > max) (max \u003d a [i] [j]; max_i \u003d i; max_j \u003d j;))) cout<< max_i << " " << max_j; return 0; }

Task number 2.

An odd number n is given, not exceeding 15. Create a two-dimensional array of n × n elements by filling it with symbols. " (Each element of the array is a string of one character). Then fill with the symbols "*" middle line of the array, the middle column of the array, the main diagonal and a side diagonal. As a result, "*" an asterisk image should form in the array. Display the resulting array on the screen, separating the elements of the array spaces.

Sample Input: 5 SAMPLE OUTPUT: * . * . * . * * * . * * * * * . * * * . * . * . *

#Include. Using Namespace STD; INT MAIN () (int n; cin \u003e\u003e< n; i++) { for (int j = 0; j < n; j++) { if (i == j || i == n - 1 - j || i == n / 2 || j == n / 2) a[i][j] = 1; else a[i][j] = 0; } } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (a[i][j] == 0) cout << "." << " "; else cout << "*" << " "; } cout << endl; } return 0; }

Task number 3.

The number n is given not exceeding 100. Create an array of N × n size and fill it in the following rule. On the main diagonal number 0 should be recorded. On two diagonals adjacent to the main number 1. On the following two diagonals of the number 2, etc.

Sample Input: 5 SAMPLE OUTPUT: 0 1 2 3 4 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 4 3 2 1 0

#Include. #Include. Using Namespace STD; int Main () (int n; cin \u003e\u003e n; int a; // Processing for (int i \u003d 0; i< n; i++) { for (int j = 0; j < n; j++) { a[i][j] = (int) abs(i - j); } } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cout << a[i][j] << " "; } cout << endl; } return 0; }

Task number 4.

Dan two-dimensional array and two numbers: i and j. Change the columns in the array with numbers i and j.
Input data format
The program receives the size of an array N and M to input, not exceeding 100, then the elements of the array, then the number I and J.
Output format
Display the result.

Sample Input:0 1 SAMPLE OUTPUT: 12 11 13 14 22 21 23 24 32 31 33 34

#Include. #Include. Using Namespace STD; INT MAIN () (int n, m, x, y, temp; cin \u003e\u003e n \u003e\u003e< n; i++) { for (int j = 0; j < m; j++) { cin >\u003e A [i] [j]; )) cin \u003e\u003e x \u003e\u003e y; // Processing for (int i \u003d 0; i< n; i++) { temp = a[i][x]; a[i][x] = a[i][y]; a[i][y] = temp; } // вывод for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cout << a[i][j] << " "; } cout << endl; } return 0; }

Task number 5.

The number n is not exceeding 10, and an array of N × n. Check if this array is symmetrical relative to the main diagonal. Display the word "yes" if the array is symmetrical, and the word "NO" otherwise.

Sample Input: 3 0 1 2 1 2 3 2 3 4 SAMPLE OUTPUT: Yes

#Include. #Include. Using Namespace STD; int Main () (int n; bool symmetric; cin \u003e\u003e n; int a; // Filling for (int i \u003d 0; i< n; i++) { for (int j = 0; j < n; j++) { cin >\u003e A [I] [J]; )) // Processing Symmetric \u003d True; for (int i \u003d 0; i< n; i++) { for (int j = 0; j < n; j++) { if (a[i][j] != a[j][i]) symmetric = false; } } // вывод if (symmetric) cout << "YES"; else cout << "NO"; return 0; }

Task number 6.

Dan is given a square two-dimensional array of N × N and the number k. Output the elements of the K-th risk diagonally below the main diagonal (i.e., if k \u003d 1, then you need to output the elements of the first diagonal underlying the main thing if K \u003d 2, then the second diagonal, etc.).
The value K may be negative, for example, if k \u003d -1, then you need to withdraw the value of the first diagonal underlying the main one. If k \u003d 0, then you need to withdraw the items of the main diagonal.
The program receives the number N, which is not exceeding 10, then an array of N × N, then the number k.

SAMPLE INPUT 1: 4 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 1 SAMPLE OUTPUT 1: 5 1 6 SAMPLE INPUT 2: 4 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 -2 SAMPLE OUTPUT 2: 3 8

#Include. Using Namespace STD; int Main () (int n, k; cin\u003e n; int a [n] [n]; // Filling for (int i \u003d 0; i< n; i++) { for (int j = 0; j < n; j++) { cin >\u003e A [i] [j]; )) cin \u003e\u003e k; // Processing and output for for (int i \u003d 0; I< n; i++) { for (int j = 0; j < n; j++) { if (i - j - k == 0) cout << a[i][j] << " "; } } return 0; }

Task number 7.

Dan a two-dimensional array of n × m (n and m does not exceed 1000). Symmetrical to him relative to the main diagonal array is called transposed to this. It has dimensions M × n: the rows of the source array become the columns of transposed, the columns of the source array become strings of transposed.
For this array, build a transposed array and output it to the screen.

Sample Input: 3 4 11 12 13 14 21 22 23 24 31 32 33 34 SAMPLE OUTPUT: 11 21 31 12 22 32 13 23 33 14 24 34

#Include. Using Namespace STD; INT MAIN () (int n, m, x, y, temp; cin \u003e\u003e n \u003e\u003e< n; i++) { for (int j = 0; j < m; j++) { cin >> < n; i++) { for (int j = 0; j < m; j++) { b[j][i] = a[i][j]; } } // вывод for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { cout << b[i][j] << " "; } cout << endl; } return 0; }

Task number 8.

In the cinema N rows according to M places in each (n and m do not exceed 20). In the two-dimensional array, information about sold tickets is stored, the number 1 means that the ticket for this place is already sold, the number 0 means that the place is free. Request a request for the sale of k tickets to neighboring places in one row. Determine if you can execute such a request.
Input data format
The program receives on the input of N and M. Next proceeds n strings containing M numbers (0 or 1) separated by spaces. Then the number k is then given.
Output format
The program should bring the number of a number in which there are K in a row of coming free places. If there are several such rows, then output the number of the smallest suitable row. If there is no suitable row, output number 0.

Sample Input: 3 4 0 1 0 1 1 0 0 1 1 1 1 1 2 SAMPLE OUTPUT: 2

#Include. Using Namespace STD; int Main () (int n, m, k, r \u003d 0; cin \u003e\u003e n \u003e\u003e m; int a [n] [m]; // Filling for (int i \u003d 0; i< n; i++) { for (int j = 0; j < m; j++) { cin >\u003e A [I] [J]; )) cin \u003e\u003e k; // Processing for (int i \u003d 0; i< n; i++) { int near_free = 0; for (int j = 0; j < m; j++) { if (a[i][j] == 0) { near_free++; if (near_free == k) { r = i + 1; break; } } else near_free = 0; } if (near_free == k) break; } // вывод cout << r; return 0; }

Task number 9.

Dan is a rectangular array of n × m. Turn it 90 degrees clockwise by writing the result to a new array of M × N.
Input data format
Two numbers N and M are introduced, not exceeding 100, then an array of n × m.
Output format
Display the resulting array. Separate numbers when displaying one space.

Sample Input: 3 4 11 12 13 14 21 22 23 24 31 32 33 34 SAMPLE OUTPUT: 31 21 11 32 22 12 33 23 13 34 24 14

#Include. Using Namespace STD; int Main () (int n, m; cin \u003e\u003e n \u003e\u003e m; int a [n] [m]; int b [m] [n]; // Filling for (int i \u003d 0; i< n; i++) { for (int j = 0; j < m; j++) { cin >\u003e A [I] [J]; )) // Processing for (int i \u003d 0; i< n; i++) { for (int j = 0; j < m; j++) { b[j] = a[i][j]; } } // вывод for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { cout << b[i][j] << " "; } cout << endl; } return 0; }

Task number 10.

According to these N and M numbers, fill in a two-dimensional array of N × M numbers from 1 to n × m "snake", as shown in the example.
Input data format
Two numbers n and m are introduced, each of which does not exceed 20.
Output format

Sample Input: 3 5 SAMPLE OUTPUT: 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15

#Include. Using Namespace STD; int main () (int n, m, c \u003d 0; cin \u003e\u003e n\u003e m; int a [n] [m]; // Processing for (int i \u003d 0; i< n; i++) { for (int j = 0; j < m; j++) { c++; if (i%2 == 0) a[i][j] = c; else a[i] = c; } } // вывод for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (a[i][j] % 10 == a[i][j]) cout << " "; else if (a[i][j] % 100 == a[i][j]) cout << " "; else if (a[i][j] % 1000 == a[i][j]) cout << " "; cout << a[i][j]; } cout << endl; } return 0; }

Task number 11.

Using these N and M numbers, fill out a two-dimensional array of N × M numbers from 1 to n × M "diagonals", as shown in the example.
Input data format

Output format
Output the resulting array, removing the output of each element exactly 4 characters.

Sample Input: 3 5 SAMPLE OUTPUT: 1 2 4 7 10 3 5 8 11 13 6 9 12 14 15

#Include. Using Namespace STD; int Main () (int n, m, pos \u003d 0, row \u003d 0; cin \u003e\u003e n \u003e\u003e m; int a [n] [m]; // Processing int start_row \u003d 0; int number \u003d 1; for ( int min_row \u003d 0; min_row< n; min_row++) { if (min_row > 0) Start_ROW \u003d POS - 1; else start_row \u003d 0; For (POS \u003d start_row; POS< m; pos++) { row = min_row; for (int col = pos; col >\u003d 0; COL--) (if (ROW< n) { a = number; number++; row++; } else break; } } } // вывод for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (a[i][j] % 10 == a[i][j]) cout << " "; else if (a[i][j] % 100 == a[i][j]) cout << " "; else if (a[i][j] % 1000 == a[i][j]) cout << " "; cout << a[i][j]; } cout << endl; } return 0; }

Task number 12.

The numbers n and m are given. Fill out an array of n × m in a checker order: the cells of the same color are filled with zeros, and another color is filled with numbers of natural rows from top to bottom, from left to right. In the upper left corner number 1 is recorded.
Input data format
Two numbers n and m are introduced, not exceeding 100.
Output format
Output the resulting array, removing the output of each element exactly 4 characters.

Sample Input: 3 5 SAMPLE OUTPUT: 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8

#Include. Using Namespace STD; int major () (int n, m, sm; cin \u003e\u003e n\u003e m; int a [n] [m]; // Processing int number \u003d 1; for (int i \u003d 0; i< n; i++) { for (int j = 0; j < m; j++) { a[i][j] = 0; } } for (int i = 0; i < n; i++) { if (i % 2 == 1) sm = 1; else sm = 0; for (int j = sm; j < m; j++) { a[i][j] = number; number++; j++; } } for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (a[i][j] % 10 == a[i][j]) cout << " "; else if (a[i][j] % 100 == a[i][j]) cout << " "; else if (a[i][j] % 1000 == a[i][j]) cout << " "; cout << a[i][j]; } cout << endl; } return 0; }

Task number 13.

According to these N and M numbers, fill in a two-dimensional array of N × M numbers from 1 to n × m along the spiral, out of the upper left corner and twisted clockwise, as shown in the example.
Input data format
Two numbers n and m are introduced, not exceeding 100.
Output format
Output the resulting array, removing the output of each element exactly 4 characters.

Sample Input: 4 5 SAMPLE OUTPUT: 1 2 3 4 5 14 15 16 17 6 13 20 19 18 7 12 11 10 9 8

#Include. Using Namespace STD; int Main () (int n, m; cin \u003e\u003e n \u003e\u003e m; int a; for (int i \u003d 0; i<= n + 1; i++) { for (int j = 0; j <= m + 1; j++) { a[i][j] = -1; } } for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { a[i][j] = 0; } } int num = 0, row = 1, col = 0; while (num < n * m) { while (a == 0) { col++; num++; a = num; } while (a == 0) { row++; num++; a = num; } while (a == 0) { col--; num++; a = num; } while (a == 0) { row--; num++; a = num; } } for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (a[i][j] % 10 == a[i][j]) cout << " "; else if (a[i][j] % 100 == a[i][j]) cout << " "; else if (a[i][j] % 1000 == a[i][j]) cout << " "; cout << a[i][j]; } cout << endl; } return 0; }

0 0

Please Enable JavaScript to View The
  • educational: to promote the formation of the presentation of the two-dimensional array and the main properties of square matrices; consider actions that can be performed above the matrix; introductory with typical matrix processing algorithms in Pascal; Create conditions for the formation of the ability to solve algorithms with two-dimensional arrays;
  • developing:
  • Create conditions for the development of skills to work for a limited period of time, developing self-work skills, development skills with abstract.
  • educational:
  • To promote the creation of psychological comfort to work, upbringing the collens, responsible attitude towards their work, increasing motivation to learning activities.

Type of lesson: Combined.

Training methods: lecture, independent work.

Forms of organization: Front work, individual work.

Equipment: Tasks for work in the classroom (individual cards, task on a computer), recordings on the board.

During the classes:

1. Organizational moment.

Greeting.
The topic is reported.
Put the purpose of the lesson and the task.

2. Actualization of the knowledge gained

Orally welcome the main points of the previous topic: "One-dimensional arrays". Frontal mini survey for basic definitions.

3. Goaling, setting tasks:

  • to define the concept of a two-dimensional array;
  • consider recording a two-dimensional array
  • consider the main properties of square matrices;
  • consider actions that can be performed above the matrix;
  • get acquainted with typical matrix processing algorithms in Pascal;
  • create conditions for the formation of the ability to solve algorithms with two-dimensional arrays;
  • 4. Lecture

    Definition.

    A two-dimensional array is a set of data, each value of which depends on two numbers, which can be viewed as a column index in the matrix.

    Recording format

    <имя>: array. [n_index_1..v_index_1, n_index_2 ..index_2] of. <тип>

    A: Array of Integer;

    In order to use an array element, you need to specify the name of the array and the index of the element. The first index corresponds to the number of the line, the second number of the column number. For example:

    for i: \u003d 1 to n do
    For j: \u003d 1 to n do
    A: \u003d Random (100);

    When initializing two-dimensional arrays, each string is an additional pair of round brackets:

    const A: MAS \u003d ((2,3,1,0),
    (1,9,1,3),
    (3,5,7,0));

    Analogue of Language Language Pascal in Mathematics are matrices. The matrix, which has the number of rows equal to the number of columns, is called square. A (N, N) - Square Matrix

    The main properties of square matrices:

    1. Square matrices have the main and adverse diagonal. For example, for the matrix, the elements 1.5 and 9 are lying on the main diagonal, and on the side - 3, 5 and 7.

    i \u003d j - elements are located on the main diagonal;
    i\u003e j - elements are located below the main diagonal;
    I. i? J - elements are located on the main diagonal and below;
    i + j \u003d n + 1- elements are located on the side diagonal;
    I + J.< n+1– элементы расположены над побочной диагональю;
    i + j\u003e n + 1- elements are located under a side diagonal;

    2. Square matrix, which all elements, excluding the elements of the main diagonal, are zero, called diagonal matrix

    3. Diagonal matrix, in which all elements standing on the main diagonal are equal to 1, called single matrix

    4. If in the matrix A (M, N), swap lines and columns, then the matrix A T (M, N) is called, which is called a transposed matrix.

    The main actions that can be performed above the matrixes

    • summarize
    • find a difference;
    • the work of the matrix for a number;
    • the product of two matrices.

    Typical Matrix Processing Algorithms in Pascal

    1. The output of the matrix in the form of a table:
    2. for i: \u003d 1 to n do
      Begin.
      For j: \u003d 1 to m doo
      Write (A: 4);
      Writeln.
      end;

    3. Using a random number generator:
    4. randomize;
      For i: \u003d 1 to m doo
      Begin.
      For j: \u003d 1 to n do
      Begin.
      A: \u003d Random (100) -10;
      Write (A: 4);
      end;
      Writeln;
      end;

    5. 2th way of outputting the matrix in the form of a table:
    6. for i: \u003d 1 to n do
      For j: \u003d 1 to m doo
      IF J\u003e M Then Write (A: 4)
      ELSE WRITELN (A: 4);

    7. Summing of matrices:
    8. for i: \u003d 1 to n do
      Begin.
      For j: \u003d 1 to m doo
      C: \u003d A + B
      end;

    9. Transposition of the matrix - a mirror reflection of its elements relative to the main diagonal. You can do it by entering a new array:

    for i: \u003d 1 to n do
    For j: \u003d 1 to n do
    b \u003d a;

    5. Primary control

    "Contour card" 2 options

    1 option

    1. Correct inaccuracies in the description of the two-dimensional array:
    2. Var.
      A \u003d Array of Integer;

      ... ... two-dimensional arrays Each line is an additional pair of parentheses:

      const A: MAS \u003d ((2,3,1,0),
      (1,9,1,3),
      (3,5,7,0));

    3. Insert the missed definitions:
    4. The main actions that can be performed above the matrices are: summation, the product of two matrices, ...., ....

    5. Insert the missed definitions:
    6. The matrix, in which the number of rows is equal to the number of columns, is called .... ... ..

    7. Find errors in the algorithm:

    for i: \u003d 1 to n do
    Begin.
    For j: \u003d 1 to m doo
    C: \u003d A + A
    end;

    Option 2

    1. Correct inaccuracies in the array description:

    const.
    n \u003d 4; m \u003d 3;
    Type
    Mas: Array of Integer;

    1. Insert the missed definitions:
    2. ...... called a set of data, each value of which depends on two numbers, which can be considered as a column index in the matrix.

    3. Insert the missed definitions:
    4. Diagonal matrix, which, all elements standing on the main diagonal, are equal ..., called single matrix

    5. Insert the missed definitions:
    6. Square matrix, which all elements, excluding the elements of the main diagonal, are zero, called … … .

    7. Find errors in the algorithm:

    randomize;
    For i: \u003d 1 to m doo
    Begin.
    For j: \u003d 1 to n do
    Begin.
    A: \u003d Random (100) -10;
    end;
    end;

    What kind of model task performs the algorithm?

    Algorithms in Pascal

    1. Write a program that for an integer matrix 3x4 defines the arithmetic arithmetic elements and the number of positive elements in each row. Appendix 2.
    2. pROGRAM SRED_N;
      const m \u003d 3;
      n \u003d 4;
      var.

      i, j, n_pos_el: integer;
      SRED: REAL;
      Begin.
      For i: \u003d 1 to m doo
      For j: \u003d 1 to n Do read (a);
      SRED: \u003d 0;
      For i: \u003d 1 to m do begin
      n_pos_el: \u003d 0;
      For J: \u003d 1 To N Do Begin
      SRED: \u003d SRAD + A;
      IF A\u003e 0 THEN INC (N_POS_EL);
      end;
      Writeln ("V", I, "- OI Stroke", N_POS_EL, "Polozitelnix Elementov");
      end;
      SRED: \u003d SRED / M / N;
      Writeln ("Srdnee Arifmeticheskoe:", SRED: 6: 2);
      end.

    3. Write a program that for a rectangular integer matrix 3x4 defines the number of the leftmost column itself containing only positive elements. If there is no such column, the message is displayed. Appendix 3.

    program num_posit;
    const m \u003d 3;
    n \u003d 4;
    var.
    A: Array of Integer;
    I, J, Num: Integer;
    All_posit: Boolean;
    Begin.
    Randomize;
    For i: \u003d 1 to m doo
    Begin.
    For j: \u003d 1 to n do
    Begin.
    A: \u003d Random (100) -10;
    Write (A: 4);
    end;
    Writeln;
    end;
    Num: \u003d 0;
    For J: \u003d 1 To N Do Begin
    All_posit: \u003d True;
    For i: \u003d 1 to m doo
    IF A.< 0 then
    Begin.
    All_posit: \u003d false;
    Break; end;
    IF All_posit Then Begin
    Num: \u003d J; Break; end;
    end;
    IF Num \u003d 0 THEN
    Writeln ("TAKIX STOLBCOV NET")
    ELSE.
    Writeln ("Nomer Stolbca:", Num);
    end.

    Pupils upload files in Pascal, analyze this algorithms, view the results of program execution, respond to additional questions:

    1. How is a two-dimensional array?
    2. What does INC procedure mean?
    3. What does the BREAK procedure mean?
    4. How is random number generator?

    6. Formation of problems solving skills.

    Solving tasks on individual cards independently, in the algorithmic environment.

    Examples of tasks:

    1. Dana matrix A 5x5, containing random elements. Find the sum of all elements of the matrix.
    2. Display Table Pythagora.
    3. Find the sum of the positive elements of the specified column of the matrix A 5x5 integers.

    7. The results of the lesson, setting the homework.

    Summarizing. Evaluation of the level of assimilation.

    D / s Abstract, Tasks:

    For all:

    1. Dan two-dimensional square array. Find numbers of lines, all the elements of which are zero.
    2. Dan two-dimensional square array. Find lines, elements in each of which are the same among themselves.
    3. Determine the minimum element of the two-dimensional array. Print the number of the string containing the maximum number of minimum elements, if any.
    4. Dan two-dimensional array. Find the string with the highest amount of elements and the smallest. Display the found lines and amounts of their elements on the screen.

    For students who have an idea of \u200b\u200btwo-dimensional arrays and ways to solve them:

    Instead of a lecture - solving problems of increased complexity.

    Examples of tasks:

    1. Dan two-dimensional array. Convert it according to the following rule: a string with number n make a column with number n, and the column is a string.
    2. In the two-dimensional array x all numbers are different. In each row, the minimum element is selected, then the maximum is selected among these numbers. Print the row number of the array in which the selected number is located.
    3. Dan two-dimensional array. Find the most from the values \u200b\u200bof the elements of the first and last row.
    4. Write a program that displays a two-dimensional array on the keyboard strings and calculates the amount of its elements by columns.
    5. Write a program that calculates the sum of the diagonal elements of the square matrix.

    Example 3.

    An integer two-dimensional array is given, dimension N x M, Find the smallest element of the array and the row number in which it is located.

    Flowchart:
    Program code:
    VAR A: Array of Integer;
    i, j, m, n, min, k: integer;
    Begin.
    Write (how many rows? '); Readln (n);
    Write (How many columns? '); Readln (m);
    For i: \u003d 1 to n do
    For j: \u003d 1 to m doo
    Begin.
    Write ('A [', I, ',', j, '] \u003d'); readln (a); (input of a two-dimensional array)
    end;
    min: \u003d a; (minimum element)
    k: \u003d 1; (Row number)
    For i: \u003d 1 to n do
    For j: \u003d 1 to m doo
    IF A.< min then
    Begin.
    min: \u003d a; k: \u003d i; (minimal and "memorizing" line numbers)
    end;
    Writeln ('The smallest number', min, 'is in', k, 'row');
    End.

    Tasks

    1. . Find the amount and work of all elements of the array.
    2. An integer two-dimensional array is given, dimension N x M. Find the amount and product of even elements.
    3. An integer two-dimensional array is given, dimension N x M. Find the amount and product of elements, multiple 3 and 5.
    4. An integer two-dimensional array is given, dimension N x M. Find the number of negative elements, more -9.
    5. An integer two-dimensional array is given, dimension N x M.
    6. An integer two-dimensional array is given, dimension N x M
    7. An integer two-dimensional array is given, dimension N x M
    8. An integer two-dimensional array is given, dimension N x M. Find the arithmetic average of all elements of the array.
    9. An integer two-dimensional array is given, dimension N x M. Find out what number is found in which line before - positive or negative.
    10. An integer two-dimensional array is given, dimension N x M. To find out which row the sequence is increasing or decreasing.
    11. An integer two-dimensional array is given, dimension N x M. Display Its elements whose indices are detects of two (1, 2, 4, 8, 16, ...).
    12. An integer two-dimensional array is given, dimension N x M. Find the number of multiple elements 7.
    13. An integer two-dimensional array is given, dimension N x M. Display elements that are squares of any number.
    14. An integer two-dimensional array is given, dimension N x M. Find numbers of odd elements on even places.
    15. An integer two-dimensional array is given, dimension N x M. Find a maximum and minimum. Change them in places.
    16. An integer two-dimensional array is given, dimension N x M. Replace all elements on their squares.
    17. An integer two-dimensional array is given, dimension N x M. Replace all elements on their opposite values.
    18. An integer two-dimensional array is given, dimension N x M. Swap the first and last elements.
    19. An integer two-dimensional array is given, dimension N x M. To form a new array consisting of opposite relevant elements.
    20. An integer two-dimensional array is given, dimension N x M. To display those elements in which the residue from division on M is equal to k.
    21. The results of the test work of 10 students are introduced. Determine the number not satisfactory, satisfactory, good, excellent marks. Take an average estimate obtained by students for testing.
    22. Introduce estimates of n students for K subjects. Determine and display the number of students who have not received any "5".
    23. In the group, N students study, students received four marks for the exam. Determine the number of poor students and the middle score of the group.
    24. An integer two-dimensional array is given, dimension N x M. Calculate the sum of the numbers whose sequence numbers are Fibonacci numbers.
    25. An integer two-dimensional array is given, dimension N x M. Fold the appropriate items.