Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream.h>
- #include <iomanip.h>
- #include <math.h>
- #include <conio.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <vcl.h>
- #pragma hdrstop
- //---------------------------------------------------------------------------
- #pragma argsused
- main()
- {
- int a[50][50], n, m;
- cout<<"Vvedite kol-vo strok matricu: ";
- cin>>n;
- cout<<"Vvedite kol-vo stolbcev matricu: ";
- cin>>m;
- for (int i=0; i<n; i++)
- for (int j=0; j<m; j++)
- if (i<j)
- a[i][j]=i+j;
- else
- a[i][j]=(i*i)-(j*j);
- for (int i=0; i<n; i++)
- {
- for (int j=0; j<m; j++)
- cout<<" "<<a[i][j]<<" ";
- cout<<endl;
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement