#include <iostream>
#define m_min 5
#define m_max 10
using namespace std;
int **connect_Tab(int **tab1,int **tab2, int width, int height)
{
int **base,i,j,k,l;
k=2*width;
l=height;
base=new int *[k];
for(i=0;i<k;i++)
base[i]=new int[l];
int i1,j1;
for(i=0,i1=1,j1=0;i<width;i++,i1+=2,j1+=2)
{
for(j=0;j<height;j++)
{
base[j1][j]=tab1[j][i];
base[i1][j]=tab2[j][i];
}
}
return base;
}
int main(int argc, char **argv)
{
int i,j,k,l;
int **tab1,**tab2;
tab1=new int *[m_min];
tab2=new int *[m_min];
for(i=0;i<m_min;i++)
{
tab1[i]=new int[m_min];
tab2[i]=new int[m_min];
}
k=0,l=1;
for(i=0;i<m_min;i++)
{
for(j=0;j<m_min;j++)
{
tab1[i][j]=k;
tab2[i][j]=l;
k+=2;
l+=2;
}
}
for(i=0;i<m_min;i++)
{
for(j=0;j<m_min;j++)
{
cout<<tab1[i][j]<<" ";
}
cout<<"\n";
}
cout<<"\n\n";
for(i=0;i<m_min;i++)
{
for(j=0;j<m_min;j++)
{
cout<<tab2[i][j]<<" ";
}
cout<<"\n";
}
cout<<"\n\n";
int **main_Tab=connect_Tab(tab1,tab2,m_min,m_min);
for(i=0;i<m_min;i++)
{
for(j=0;j<m_max;j++)
{
cout<<main_Tab[j][i]<<" ";
}
cout<<"\n";
}
for(i=0;i<m_min;i++)
{
delete [] tab1[i];
delete [] tab2[i];
}
delete [] tab1;
delete [] tab2;
return 0;
}
YOU CAN PAY ME - https://paypal.me/LukaszW77?locale.x=pl_PL