lol

C code posted by Yo
created at 03 Mar 00:14, updated at 10 Mar 16:11

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>

int main(int argc,char * argv[])
{
const int indexes[3][2]={{0,6},{7,11},{11,16}};
int temp[16][12];
int sum[3][12];
int i,j,z;


///testovaci data///////////////
for (i=0;i<16;i++)
  for (j=0;j<12;j++)
    temp[i][j]=i+j;
///////////////////////////////


for (i=0;i<3;i++)
{
  for (j=0;j<12;j++)
  {
    sum[i][j]=0;
  }
}

for (i=0;i<12;i++)
{
  for (j=0;j<3;j++)
  {
    for (z=indexes[j][0];z<indexes[j][1];z++)
    {
      sum[j][i]+=temp[z][i];
    }
  }

}

for (i=0;i<12;i++)
{
  for (j=0;j<3;j++)
  {
    printf("%d ",sum[j][i]);
  }
  printf("\n");
}

}
604 Bytes in 9 ms with coderay