Sum an array · Soma de um array
Sum an array
Add the n integers that a points to. A pointer like const int *a works just like an array — a[i] is the i-th element.
Some um array
Some os n inteiros aos quais a aponta. Um ponteiro como const int *a funciona igual a um array — a[i] é o i-ésimo elemento.
Complete int sum_array(const int *a, int n) to return the sum of the n elements. Do not write main — the checker provides one. · Complete int sum_array(const int *a, int n) para retornar a soma dos elementos n. Não escreva main — o verificador fornece um.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.