#include <iostream>
using namespace std;

int main() {
    int matriz[3][3]; // Declara uma matriz 3x3

    // Entrada de dados
    cout << "Digite os elementos da matriz 3x3:" << endl;
    for (int i = 0; i < 3; i++) { // Percorre as linhas
        for (int j = 0; j < 3; j++) { // Percorre as colunas
            cin >> matriz[i][j]; // Lê cada elemento
        }
    }

    // Exibir a matriz
    cout << "Matriz digitada:" << endl;
    for (int i = 0; i < 3; i++) { // Percorre as linhas
        for (int j = 0; j < 3; j++) { // Percorre as colunas
            cout << matriz[i][j] << " "; // Exibe cada elemento
        }
        cout << endl; // Pula uma linha ao final de cada linha da matriz
    }

    return 0;
}

Embed on website

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