Bun venit Guest | RSS
Bine ati venit la 9C acasa
Meniul Site-ului
Horoscop
Exprima-ti opinia
Ce parere aveti despre site?
1. Foarte buna
2. Foarte proasta
3. Buna
4. Normal
5. Proasta
[ Vezi rezutat ยท Arhiva ]
Raspunsuri: 42
Mini chat

Info


Main » 2009 » Mai » 26 » produsul a doua matrici
produsul a doua matrici
13:50

#include <iostream.h>

void main(void)

{

int n,m,p,i,j,k,a[10][10],b[10][10],c[10][10];

cout<<"Dati dimensiunile matricei "<<endl;

cout<<"Dati numarul de linii n = ";cin>>n;

cout<<"Dati numarul de coloane m = ";cin>>m;

for(i=1;i<=n;i++)

for(j=1;j<=m;j++)

{

cout<<"a["<<i<<","<<j<<"]= ";

cin>>a[i][j];

}

cout<<"Elementele matricei A sunt: "<<endl;

for(i=1;i<=n;i++)

{

for(j=1;j<=m;j++)

cout<<a[i][j]<<" ";

cout<<endl;

}

cout<<"Dati numarul de linii m = ";cin>>m;

cout<<"Dati numarul de coloane p = ";cin>>p;

for(i=1;i<=m;i++)

for(j=1;j<=p;j++)

{

cout<<"b["<<i<<","<<j<<"]= ";

cin>>b[i][j];

}

cout<<"Elementele matricei B sunt: "<<endl;

for(i=1;i<=m;i++)

{

for(j=1;j<=p;j++)

cout<<b[i][j]<<" ";

cout<<endl;

}

for(i=1;i<=n;i++)

for(j=1;j<=p;j++)

for(k=1;k<=m;k++)

c[i][j]+=a[i][k]*b[k][j];

cout<<"Elementele matricei produs "<<endl;

for(i=1;i<=n;i++)

{

for(j=1;j<=p;j++)

cout<<c[i][j]<<" ";

cout<<endl;

}

}

Views: 141 | Added by: Iulian
Only registered users can add comments.
[ Registration | Login ]
Logheaza-te
Calendar
«  Mai 2009  »
DuLuMaMiJoViSa
     12
3456789
10111213141516
17181920212223
24252627282930
31
Meteo
Curs Valutar
Curs Valutar BNR
Cautare
Link-uri
Statistica
Director web gratuit - Afisare Thumbnail, Transfer Google PageRank, Meta keywords si meta description personalizate pentru fiecare link Site clasei 9C Colegiul National Mihai Eminescu, Muzica Stiri Sport, Filme Top66 Statistici
Total online: 1
Guests: 1
Users: 0