11672 - simple exercise of pointer on array   

Description

In this exercise, you should calculate the sum of a given 2 dimensional integer array.

We have written the code about reading the size and the content of the array, and we want to pass them to a function to calculate the final answer. What you need is helping us to complete the function. 

What input into the function is the pointer, the width and the length of the array, and the function has to return the sum of the whole array.

For more specific, you only need to implement the following function:

#include <stdio.h>
#include "function.h"
int get_sum(int** int_2D_array, int length, int width)
{
    // Write your code here
}

The .c and .h file below might be helpful if you wnat to know how the function and the whole program works.

For simplify the question, we garantee that the final answer can be represented as a integer.

Input

The size and the content of a 2-D array.

 

Output

The sum of the total array.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11672.c

Partial Judge Header

11672.h

Tags




Discuss