Умножить двумерный массив на x — C++(Си)

#include <iostream.h>
#include <conio.h>
//---------------------------------------------------------------------------
int main()
{
    const int N = 10;
    int a[N][N] = {NULL};
    int sum = 0, count = 0;
 
    int mn = 0;
 
    cout << "Enter value: ";
    cin >> mn;
 
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            a[i][j] = -10 + rand()%20;
            cout << a[i][j] << " ";
            if (j == N-1) { cout << endl; }
        }
    }
 
    cout << endl << endl;
 
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            a[i][j] *= mn;
            cout << a[i][j] << " ";
            if (j == N-1) { cout << endl; }
        }
    }
 
    getch();
    return 0;
}

Leave a Comment