#include <iostream>
#include <ctime>
#include <iomanip>
#include <vector>
using namespace std;
typedef vector< vector<int> > T;
ostream &operator<<(ostream &output,const T &mass)
{
for(size_t i = 0;i<mass.size();++i){
for(size_t j = 0;j<mass.size();++j)
output<<setw(5)<<mass[j];
output<<"\n\n";
}
return output;
int _tmain(int argc, _TCHAR* argv[])
srand((unsigned)time(0));
unsigned int row,col;
do{
cout<<"Enter rows > 0"<<endl;
cin>>row;
}while(row <= 0);
cout<<"Enter col > 0"<<endl;
cin>>col;
}while(col <= 0);
T mass(row, vector<int>(col));
for(size_t i = 0;i < row;++i){
for(size_t j = 0;j < col;++j)
mass[j] = rand()%10;
cout<<mass;
return 0;
#include <iostream>
#include <ctime>
#include <iomanip>
#include <vector>
using namespace std;
typedef vector< vector<int> > T;
ostream &operator<<(ostream &output,const T &mass)
{
for(size_t i = 0;i<mass.size();++i){
for(size_t j = 0;j<mass.size();++j)
output<<setw(5)<<mass[j];
output<<"\n\n";
}
return output;
}
int _tmain(int argc, _TCHAR* argv[])
{
srand((unsigned)time(0));
unsigned int row,col;
do{
cout<<"Enter rows > 0"<<endl;
cin>>row;
}while(row <= 0);
do{
cout<<"Enter col > 0"<<endl;
cin>>col;
}while(col <= 0);
T mass(row, vector<int>(col));
for(size_t i = 0;i < row;++i){
for(size_t j = 0;j < col;++j)
mass[j] = rand()%10;
}
cout<<mass;
return 0;
}