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

📄 array1d.cpp

📁 data structures, algorithms and Application书的源代码
💻 CPP
字号:

// test 1D array class

#include <iostream.h>
#include "array1d.h"

void main(void)
{
   try {
      Array1D<int> X(10), Y, Z;
      for (int i=0; i < 10; i++)
         X[i] = i;
      cout << "X[3] = " << X[3] << endl;
      cout << "X is " << X << endl;
      Y = X;
      cout << "Y is " << Y << endl;
      X += 2;
      cout << "X incremented by 2 is " << X << endl;
      Z = (Y + X) * Y;
      cout << "(Y + X) * Y is " << Z << endl;
      cout << "-(Y + X) * Y is " << -Z << endl;
      }
   catch (...) {
      cerr << "An exception has occurred" << endl;}
}

⌨️ 快捷键说明

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