Title / Description
Code #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"); } }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code