lundi 5 février 2018

Completely lost on making a user inputed matrix

I very new to c++ and for school I need to create a program that asks a user to create two matrices. The program needs to ask the user the row and column size of each matrix and then ask the user to input each integer for the matrix. This is what I have so far and I'm completely lost. Apologies for asking for so much.

This is how it should look if that helps:

input the row size and col size of A
3 2
input matrix A
2 1
-1 0
3 4
input the row size and col size of B
3 2
input matrix B
12 -18
3 9
6 -3

This is what I have:

#include <iostream>
using namespace std:

int main()
{
        int rowa, cola;
        int matrixA[rowa][cola];
        cout<<"Input the row size and col size of A"<<endl;
        cin>>rowa>>cola>>endl;
        cout<<"Input matrix A"<<endl;



        int rowb, colb;
        int matrixB[rowb][colb];
        cout<<"Input the row size and col size of B"<<endl;
        cin>>rowb>>colb>>endl;
        cout<<"Input matrix B"<<endl;

        return 0;
}

Aucun commentaire:

Enregistrer un commentaire