// Grzegorz Bortnik

#include <iostream>

using namespace std;

int main()
{
    int tab[10][10];
    int m, n;
    int suma = 0;
    int wyborM, wyborN;

    cout << "Podaj liczbe wierszy od 1 do 10: ";
    cin >> m;

    cout << "Podaj liczbe kolumn od 1 do 10: ";
    cin >> n;

    for (int i = 0; i < m; i++)
    {
        for (int j = 0; j < n; j++)
        {
            cout << "Podaj element [" << i << "][" << j << "]: ";
            cin >> tab[i][j];

            suma = suma + tab[i][j];
        }
    }

    cout << endl;
    cout << "Zawartosc tablicy:" << endl;

    for (int i = 0; i < m; i++)
    {
        for (int j = 0; j < n; j++)
        {
            cout << tab[i][j] << " ";
        }

        cout << endl;
    }

    cout << endl;
    cout << "Suma wszystkich elementow:" << endl;
    cout << suma << endl;

    cout << endl;
    cout << "Podaj indeks wiersza od 0 do " << m - 1 << ": ";
    cin >> wyborM;

    cout << "Podaj indeks kolumny od 0 do " << n - 1 << ": ";
    cin >> wyborN;

    cout << "Wybrany element:" << endl;
    cout << tab[wyborM][wyborN] << endl;

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: