Advertisement
greannmhar

main.cpp

Oct 14th, 2024
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include "Matrix.hpp"
  2. #include <iostream>
  3.  
  4. int main() {
  5. int size_A, size_B;
  6. std::cout << "Enter matrix A size: ";
  7. std::cin >> size_A;
  8.  
  9. Matrix A(size_A);
  10. std::cout << "Enter elements of matrix A:\n";
  11. std::cin >> A;
  12.  
  13. std::cout << "Matrix A:\n" << A;
  14.  
  15. std::cout << "Transpose of A:\n" << A.transpose();
  16. std::cout << "Enter matrix B size: ";
  17. std::cin >> size_B;
  18. Matrix B(size_B);
  19. std::cout << "Enter elements of matrix B:\n";
  20. std::cin >> B;
  21.  
  22. Matrix C = A + B;
  23. std::cout << "A + B =\n" << C;
  24.  
  25. Matrix D = A * B;
  26. std::cout << "A * B =\n" << D;
  27.  
  28. std::cout << "Determinant of A: " << A.determinant() << std::endl;
  29.  
  30. return 0;
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement