SHARE
TWEET

Untitled

a guest Sep 22nd, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. std::ostream& operator<<(std::ostream& os, const Matrix& A)
  2. {
  3.     for (int i = 0; i < A.size; i++)
  4.     {
  5.         os << std::endl;
  6.         for (int j = 0; j < A.size; j++)
  7.             os<<  std::setw(5) << A.matrix[i][j];
  8.     }
  9.     return os;
  10. }
  11.  
  12. std::istream& operator>>(std::istream& is, Matrix& A)
  13. {
  14.     std::cout << "Input matrix size: ";
  15.     is >> A.size;
  16.     std::cout << std::endl;
  17.  
  18.     std::cout << "Initialize matrix:" << std::endl;
  19.     for (int i = 0; i < A.size; i++)
  20.     {
  21.         for (int j = 0; j < A.size; j++)
  22.         {
  23.             is >> A.matrix[i][j];
  24.         }
  25.     }
  26.     return is;
  27.  
  28. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top