Sum an array · Somme d'un tableau
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.
Sommer un tableau
Additionnez les n entiers auxquels pointe a. Un pointeur comme const int *a fonctionne comme un tableau — a[i] est l'élément i-ème.
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. · Complétez int sum_array(const int *a, int n) pour retourner la somme des n éléments. N'écrivez pas main — le vérificateur en fournit un.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.