SHARE
TWEET

Untitled

a guest Jan 27th, 2020 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void cit(int a[10][10], int &m, int &n)
  6. {
  7.     int i, j;
  8.     cout<<"m = ";
  9.     cin>>m;
  10.     cout<<"n = ";
  11.     cin>>n;
  12.     for(i=1; i<=m; i++)
  13.         for(j=1; j<=n; j++)
  14.             cin>>a[i][j];
  15. }
  16.  
  17. void afis(int a[10][10], int m, int n)
  18. {
  19.     int i, j;
  20.     for(i=1; i<=m; i++)
  21.     {
  22.         for(j=1; j<=n; j++)
  23.             cout<<a[i][j]<<" ";
  24.         cout<<endl;
  25.     }
  26. }
  27.  
  28. //Sa se construiasca o noua matrice b care sa fie oglindita matricei a, in raport cu axa Oy
  29.  
  30. void oglindire(int a[10][10], int b[10][10], int m, int n)
  31. {
  32.     int i, j;
  33.     for(i=1; i<=m; i++)
  34.         for(j=1; j<=n; j++)
  35.             b[i][n-j+1]=a[i][j];
  36. }
  37.  
  38. int main()
  39. {
  40.     int a[10][10], b[10][10], m, n;
  41.     cit(a, m, n);
  42.     cout<<endl;
  43.     afis(a, m, n);
  44.     cout<<endl<<endl;
  45.     oglindire(a, b, m, n);
  46.     afis(b, m, n);
  47.     return 0;
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top