#include <cstdlib>
#include <iostream>
using namespace std;
class Arr2
{
private : int i1,i2; //property
public : void Masuk()
{
cout<<"Jumlah Baris = ";
cin>>i1;
cout<<"Jumlah Kolom = ";
cin>>i2;
cout<<endl;
int matrik [i1][i2]; //deklarasi dan inisialisasi array
//mengisi array
for(int i = 0; i<i1; i++)
{
for(int j = 0; j<i2; j++)
{
cout<<"Nilai matrik ke ["<<i<<","<<j<<"] = ";
cin>>matrik [i][j];
}
}
cout<<endl;
//menampilkan isi matrik
for(int i = 0; i<i1; i++)
{
for(int j = 0; j<i2; j++)
{
cout<<"Isi matrik ke ["<<i<<","<<j<<"] adalah "<<matrik [i][j]<<endl;
}
}
}
};
int main(int argc, char *argv[])
{
Arr2 arre; //deklarasi Class Arr2
arre.Masuk(); //panggil Method Masuk dari Class Arr2
cout<<endl;
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}