The original question on Stack Overflow can be restated as follows.
Given a two-dimensional array, I wish to sum each 2 x 2 subarray and produce an output two-dimensional array. For example, if I have the folllowing 4 x 5 input array
50 45 47 52 54
49 52 50 50 51
51 52 51 45 48
50 47 54 47 52
I wish to produce the following 3 x 4 output array.
196 194 199 207
204 205 196 194
200 204 197 192
In order to do this, you'll need four nested for loops.
The first two for loops will loop through the starting position of the subarray you want to sum. The second two for loops will loop through the subarray, summing the values.
To the original poster: If English is not your native language, write your question and expanation in your native language and use Google translate to translate your question and expanation into English. You need to clearly state the problem, possible inputs, and desired outputs for your question to make sense.