Помогите перемножить матрицы С
Даны 2 матрицы: 3 на 4 и 4 на 1. Помогите быстрее !!! сейчас кр по С!!!
мы не знаем рекурсию, только начали двумерные массивы...
Помогите еще мало выучили полный завал.
Вот то что успел наваять:
#include<iostream>
#include<windows.h>
#include<iomanip>
#include<math.h>
#include<time.h>
#include<stdlib.h>
using namespace std;
void main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
const int row=3;
const int col=4;
const int col1=4;
const int row1=3;
const int col2=1;
const int row2=4;
int ar1[row1][col1];
int ar2[row2][col2];
int res[row][col];
int x,y;
cout<<"Введите х: ";cin>>x;
cout<<"Введите y: ";cin>>y;
cout<<endl;
for(int i=0; i<row1; i++)
{
for(int j=0; j<col1;j++)
{
ar1[i][j]=rand()%(y+1-x)+x;
cout<<setw(2)<<ar1[i][j]<<" ";
}
cout<<endl;
}
cout <<endl;
for(int i=0; i<row2; i++)
{
for(int j=0; j<col2;j++)
{
ar2[i][j]=rand()%(y+1-x)+x;
cout<<setw(2)<<ar2[i][j]<<" ";
}
cout<<endl;
}
cout<<endl;
|