• + 0 comments
    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include <stdlib.h>
    int getsum(int n)
    {
        int a[1000],sum=0;
        for (int i=0;i<n;i++)
        {
            scanf("%d ",&a[i]);
            sum=sum+a[i];
        }
        printf("%d",sum);
        return 0;
    }
    int main()
    {
        int n;
        scanf("%d",&n);
        getsum(n);
    }