#include
#include
#include
#include
class matrix{
friend ostream& operator<>(istream&, matrix&);
public :
void input_matrix();
void perkalian_2matrix(const matrix&, const matrix&);
private:
int M[20][20];
int baris, kolom;
};
void matrix::input_matrix(){
int i,j;
for(i=0;i
}
}
}
void matrix::perkalian_2matrix(const matrix& matrix1, const matrix& matrix2){
int i,j,k;
int barkol;
baris=matrix1.baris;
kolom=matrix2.kolom;
barkol=matrix1.kolom;
if(matrix1.kolom!=matrix2.baris){
cout<<"Tidak bisa menampilkan"<
for(i=0;i
cout<>input.baris;
cout<>input.kolom;
cout<<"Masukkan data matrix = ";
input.input_matrix();
return in;
}
ostream& operator<<(ostream& out, matrix& output){
int i,j;
for(i=0; i
}
cout<
cout<
cout<
Tidak ada komentar:
Posting Komentar