#include<iostream>
using namespace std;
void display()
{
int r,c; int ary[100][100];
cout <<"row ?\nans:"; cin>> r; cout <<endl;
cout <<"coulmn ?\nans:"; cin>> c; cout <<endl;
cout <<"put the numbers and keep pressing ENTER afterwards:\n";
for (int x=0; x<r; x++)
{
for (int y=0; y<c; y++)
cin>> ary[x][y];
}
cout <<endl;
cout <<"your matrix:\n";
for (int x=0; x<r; x++)
{
for (int y=0; y<c; y++)
{
cout<<ary[x][y] <<" ";
}
cout<<endl;
}
}
int main()
{
display();
}
using namespace std;
void display()
{
int r,c; int ary[100][100];
cout <<"row ?\nans:"; cin>> r; cout <<endl;
cout <<"coulmn ?\nans:"; cin>> c; cout <<endl;
cout <<"put the numbers and keep pressing ENTER afterwards:\n";
for (int x=0; x<r; x++)
{
for (int y=0; y<c; y++)
cin>> ary[x][y];
}
cout <<endl;
cout <<"your matrix:\n";
for (int x=0; x<r; x++)
{
for (int y=0; y<c; y++)
{
cout<<ary[x][y] <<" ";
}
cout<<endl;
}
}
int main()
{
display();
}
k
ReplyDelete