#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
int k;
int baris;
int i;
int j;
int kolom;
int matriks2[100][100];
int kali[100][100];
int matriks[100][100];
raptor_prompt_variable_zzyz ="Masukkan Baris :";
cout << raptor_prompt_variable_zzyz << endl;
cin >> baris;
raptor_prompt_variable_zzyz ="masukkan Kolom : ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> kolom;
i =1;
while (!(i>baris))
{
j =1;
while (!(j>kolom))
{
raptor_prompt_variable_zzyz ="Isi matriks";
cout << raptor_prompt_variable_zzyz << endl;
cin >> matriks[i][j];
j =j+1;
}
i =i+1;
}
i =1;
while (!(i>baris))
{
j =1;
while (!(j>kolom))
{
raptor_prompt_variable_zzyz ="Isi Matriks";
cout << raptor_prompt_variable_zzyz << endl;
cin >> matriks2[i][j];
j =j+1;
}
i =i+1;
}
i =1;
while (!(i>baris))
{
j =1;
while (!(j>kolom))
{
if (baris==kolom)
{
kali[i][j] = 0;
k =1;
while (!(k>baris))
{
kali[i][j] = kali[i][j]+matriks[i][k]*matriks2[k][j];
k =k+1;
}
}
else
{
cout << "tidak bisa di kalikan" << endl; }
j =j+1;
}
i =i+1;
}
i =1;
while (!(i>baris))
{
j =1;
while (!(j>kolom))
{
cout << "Output Matriks 1 : "<<matriks[i][j] << endl; j =j+1;
}
i =i+1;
}
i =1;
while (!(i>baris))
{
j =1;
while (!(j>kolom))
{
cout << "Output Matriks 2 : "<<matriks2[i][j] << endl; j =j+1;
}
i =i+1;
}
i =1;
while (!(i>baris))
{
j =1;
while (!(j>kolom))
{
cout << "Perkalian Matriks : "<<kali[i][j] << endl; j =j+1;
}
i =i+1;
}
system("pause");
return 0;
}
Tidak ada komentar:
Posting Komentar