So I have an array like `{1, 4, 2, 3, 5, 3, 7}` and I have to make a new array containing the sums of each 3 consecutive elements like `{7, 9, 10, 11, 15}`.
So far I got here and I don't know what I'm doing wrong.

```
#include <iostream>
#include <conio.h>

using namespace std;

int a[] = {1, 1, 2, 3, 5, 3, 7};
int lung = sizeof(a)/sizeof(a[0]);
int *l = new int[10];

int calc(int *a, int m)
{
    int sum = 0;
    int stmax = (lung - m) - 1; 
    for(int st=0;st <= stmax; st++)
    {
        for(int i = 0; i < m; i++)
        {
            sum = sum + a[st+i];
        }
        l[st] = sum;
    }
    return 0;   
}

void main()
{
    int a[] = {1, 1, 2, 3, 5, 3, 7};
    cout << calc(a, 3)<< endl;
    for (int i = 0; i < lung; i++)
    {
        cout << l[i] << " | ";
    }
    _getch();
}

```