Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int **kop(int **tab,int m,int n)
- {
- int **wsk=(int**)malloc(sizeof(int*)*m);
- for(int i=0;i<m;i++)
- {
- wsk[i]=(int*)malloc(sizeof(float)*n);
- for(int j=0;j<n;j++)
- wsk[i][j]=tab[i][j];
- }
- return wsk;
- }
- int main(int argc, char *argv[])
- {
- int n,m;
- cout<<"Podaj n i m:";
- cin>>m>>n;
- int **tab;
- tab=(int**)malloc(sizeof(int*)*m);
- for(int i = 0;i<n;i++)
- tab[i]=(int*)malloc(sizeof(int)*n);
- for(int i=0;i<m;i++)
- for(int j=0;j<n;j++)
- cin>>tab[i][j];
- int **wsk=kop(tab,m,n);
- for(int i=0;i<m;i++)
- for(int j=0;j<n;j++)
- cout<<wsk[i][j];
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement