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

📄 unchanging1.c

📁 gcc-you can use this code to learn something about gcc, and inquire further into linux,
💻 C
字号:
// Special g++ Options: -O2#include <iostream>#include <complex>using namespace std;class A {protected:  int a;  complex<double> *b;public:  A(int n);  inline complex<double>& operator[] (int x);};A::A(int n){  a = n;  b = new complex<double>[a];  for (int i=0; i<a; i++) b[i] = complex<double>(0.0,0.0);}inline complex<double>& A::operator[](int x){  if (x < 0 || x >= a)    cout << "x error" << endl;  return b[x];}void foo (){  int n = 5;  A *o = new A(n);  A *p = new A(n);  for (int i = 0; i < n; i++) {    cout << i << endl;    (*o)[i] *= complex<double>((*p)[i].real(), (*p)[i].imag());  }}int main(){  foo();}

⌨️ 快捷键说明

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