Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <cstdlib>
- #define M 3
- #define N 3
- using namespace std;
- int main()
- { srand(time(NULL));
- int tab[M][N];
- int tab2[M][N];
- int pom;
- for(int i=0;i<M;i++)
- {
- for(int j=0;j<N;j++)
- {
- tab[i][j]=rand()%10-5;
- }
- }
- for(int i=0;i<M;i++)
- {
- for(int j=0;j<N;j++)
- {
- cout<<tab[i][j]<<" ";
- }
- cout<<endl;
- }
- cout<<endl<<endl;
- for(int i=0;i<M;i++)
- {
- for(int j=0;j<N;j++)
- {
- tab2[i][j]=tab[M-1-i][N-1-j];
- }
- }
- for(int i=0;i<M;i++)
- {
- for(int j=0;j<N;j++)
- {
- cout<<tab2[i][j]<<" ";
- }
- cout<<endl;
- }
- cout<<endl<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement