A Very Big Sum

Sort by

recency

|

2008 Discussions

|

  • + 0 comments

    include

    using namespace std;

    int main() { int n; int i; cin>>n; long int arr[n]; long int sum=0; for( i=0;i>arr[i];

    }
    for(i=0;i<n;i++)
    {
        sum=sum+arr[i];
    }
    cout<<sum;
    return 0;
    

    }

  • + 0 comments

    return ar.reduce(0, +)

  • + 0 comments

    I have no clue what this question is asking me to do

  • + 0 comments

    resume in C

    include

    int main(){

    int x;
    scanf("%d",&x);
    int array[x];
    
    for(int i = 0 ; i < x ; i++){
    
        scanf("%d",&array[i]);
    
    }
    
    long int array_soma;
    
    for(int i = 0 ; i < x ; i++){
    
        array_soma += array[i];
    
    }
    
    printf("%ld",array_soma);
    
    return 0;
    

    }

  • + 0 comments
    function aVeryBigSum(ar) {
        let total = 0;
        for(let item of ar){
            if(Array.isArray(item)) total += aVeryBigSum(item);
            total += item;
        }
        return total;
    }