Sum an array · סיכום מערך
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · עמוד זה דורש דפדפן עדכני (תומך ב-SharedArrayBuffer). אנא עדכן את Chrome, Edge, Firefox או Safari לגרסה העדכנית ביותר.
English
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.
עברית
סיכום מערך
סכם את n שלמים עליהם מצביע a. מצביע כמו const int *a פועל בדיוק כמו מערך — a[i] הוא האלמנט ה-i-י.
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. · השלם את int sum_array(const int *a, int n) כדי להחזיר את הסכום של ⟨⟩n אלמנטים. אל תכתוב main — המבדק מספק אותו.
Click Run to see the output here. · לחץ על הרץ כדי לראות את התוצא כאן.