#include <iostream>

using namespace std;

class Vektor {
  private:
    double* ap; // Zeiger auf/C-Array von doubles
    int    len; // Länge

  public:
    Vektor(): ap(nullptr), len(0) {} // Leerer Vektor
    Vektor(int n, double x = 0): len(n) { // n Kopien von x
      ap = new double[n];
      for (int i = 0; i < n; i++) ap[i] = x;
    }

    /* Auskommentiert
    ~Vektor() {
      delete[] ap;
    }
    */

    double sum() {
      double s = 0;
      for (int i = 0; i < len; i++) s += ap[i];
      return s;
    }
};

int main() {
  Vektor a(1);
  cout << a.sum() << endl;
}
