Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  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. //Rotirea cu 90 de grade in sensul acelor de ceasornic
  29.  
  30. void oglindire(int a[10][10], int b[10][10], int &m, int &n)
  31. {
  32. int i, j, aux;
  33. for(i=1; i<=m; i++)
  34. for(j=1; j<=n; j++)
  35. b[j][m-i+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, n, m);
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement