⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trirow.cpp

📁 数据结构c++语言描述 Borland C++实现
💻 CPP
字号:

// test TriByRows matrix class

#include<iostream.h>
#include<stdlib.h>
#include "trirow.h"

void main(void)
{
   try {
      TriByRows<int> A(20);
      A.Store(22,1,1).Store(44,5,5);
      A.Store(55,7,8).Store(0,8,5);
      cout << A.Retrieve(7,8) << endl;
      cout << A.Retrieve(5,5) << endl;
      cout << A.Retrieve(1,1) << endl;
      cout << A.Retrieve(10,1) << endl;
      cout << A.Retrieve(1,5) << endl;

      TriByRows<int> X, Y, Z;
      cin >> X;
      cout << "X is " << endl
           << X << endl;
      Y = X;
      cout << "Y is " << endl
           << Y << endl;
      X += 2;
      cout << "X incremented by 2 is "
           << endl << X << endl;
      Z = Y + X;
      cout << "Y + X is " 
           << endl << Z << endl;
      cout << "-(Y + X) is " 
           << endl << -Z << endl;
      cout << "X transpose is " 
           << endl << X.Transpose() << endl;
      }
   catch (...) {
      cerr << "An exception has occurred" << endl;}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -