1- #include  "multi_arrays .h" 
1+ #include  "arrays .h" 
22
3- #include  <string.h> 
4- 
5- struct  MyStructMult  {
6-     int  a [2 ][3 ][2 ];
7- };
8- 
9- struct  IntArray  {
10-     int  ints [2 ][5 ];
11- };
12- 
13- struct  PointStruct  {
14-     int  x ;
15-     int  y ;
16- };
17- 
18- 
19- int  kek (int  a [1 ][2 ]) {
20-     return  1 ;
3+ int  get_00_elem (int  a [1 ][2 ]) {
4+     return  a [0 ][0 ];
215}
226
23- 
24- int  sumSign (int  a [2 ][2 ]) {
7+ int  sum_sign (int  a [2 ][2 ]) {
258    int  sum  =  0 ;
269    for  (int  i  =  0 ; i  <  2 ; i ++ ) {
2710        for  (int  j  =  0 ; j  <  2 ; j ++ ) {
@@ -37,6 +20,25 @@ int sumSign(int a[2][2]) {
3720    }
3821}
3922
23+ int  sum_sign_1d_small (int  a [9 ]) {
24+     int  sum  =  0 ;
25+     for  (int  i  =  0 ; i  <  9 ; i ++ ) {
26+         sum  +=  a [i ];
27+         if  (i  % 2  ==  0 ) {
28+             sum ++ ;
29+         } else  {
30+             sum -- ;
31+         }
32+     }
33+     if  (sum  ==  0 ) {
34+         return  0 ;
35+     } else  if  (sum  >  0 ) {
36+         return  1 ;
37+     } else  {
38+         return  -1 ;
39+     }
40+ }
41+ 
4042int  value (int  a [2 ][3 ]) {
4143    for  (int  i  =  0 ; i  <  2 ; i ++ ) {
4244        for  (int  j  =  0 ; j  <  3 ; j ++ ) {
@@ -48,7 +50,7 @@ int value(int a[2][3]) {
4850    return  -1 ;
4951}
5052
51- int  value2 (int  (*   a )[3 ]) {
53+ int  value2 (int  (* a )[3 ]) {
5254    for  (int  i  =  0 ; i  <  2 ; i ++ ) {
5355        for  (int  j  =  0 ; j  <  3 ; j ++ ) {
5456            if  (a [i ][j ] >  0 ) {
@@ -60,8 +62,7 @@ int value2(int (* a)[3]) {
6062}
6163
6264
63- int  some_method (int  * *  pointer2d ) {
64-     int  x  =  2 ;
65+ int  some_method (int  * * pointer2d ) {
6566    for  (int  i  =  0 ; i  <  2 ; i ++ ) {
6667        for  (int  j  =  0 ; j  <  2 ; j ++ ) {
6768            if  (pointer2d [i ][j ] >  0 ) {
@@ -75,13 +76,13 @@ int some_method(int ** pointer2d) {
7576int  return_sign_sum (struct  MyStructMult  st ) {
7677    int  res  =  0 ;
7778    for  (int  i  =  0 ; i  <  2 ; i ++ ) {
78-         for (int  j  =  0 ; j  <  3 ; j ++ ) {
79+         for   (int  j  =  0 ; j  <  3 ; j ++ ) {
7980            for  (int  k  =  0 ; k  <  2 ; k ++ ) {
8081                res  +=  st .a [i ][j ][k ];
8182            }
82-         }   
83+         }
8384    }
84-      
85+ 
8586    if  (res  >  0 ) {
8687        return  1 ;
8788    } else  if  (res  ==  0 ) {
@@ -98,7 +99,7 @@ long long return_sign_sum_of_struct_array(struct PointStruct arr[2][2]) {
9899            if  (arr [i ][j ].x  >  0 ) {
99100                sumDiffs  +=  arr [i ][j ].x ;
100101            } else  {
101-                   sumDiffs  +=  - arr [i ][j ].x ;
102+                 sumDiffs  +=  - arr [i ][j ].x ;
102103            }
103104
104105            if  (arr [i ][j ].y  >  0 ) {
@@ -111,31 +112,31 @@ long long return_sign_sum_of_struct_array(struct PointStruct arr[2][2]) {
111112    return  sumDiffs ;
112113}
113114
114- int  point_quart (struct  PointStruct  * *   point ) {
115+ int  point_quart (struct  PointStruct  * * point ) {
115116    if  ((* * point ).x  >  0 ) {
116-           if  ((* * point ).y  >  0 ) {
117-               return  1 ;
118-           } else  {
119-               return  4 ;
120-           }
117+         if  ((* * point ).y  >  0 ) {
118+             return  1 ;
119+         } else  {
120+             return  4 ;
121+         }
121122    } else  {
122-           if  ((* * point ).y  >  0 ) {
123-               return  2 ;
124-           } else  {
125-               return  3 ;
126-           }
123+         if  ((* * point ).y  >  0 ) {
124+             return  2 ;
125+         } else  {
126+             return  3 ;
127+         }
127128    }
128129}
129130
130131struct  IntArray  return_struct_with_2d_array (int  a ) {
131132    if  (a  >  0 ) {
132-         struct  IntArray  st  =  {{{1 , 2 , 3 , 4 , 5 }, {1 , 2 , 3 , 4 , 5 }}};
133+         struct  IntArray  st  =  {{{  1 ,  2 ,  3 ,  4 ,  5   }, {  1 ,  2 ,  3 ,  4 ,  5   }}};
133134        return  st ;
134135    } else  if  (a  <  0 ) {
135-         struct  IntArray  st  =  {{{-1 ,-2 ,-3 ,-4 ,-5 }, {-1 ,-2 ,-3 ,-4 ,-5 }}};
136+         struct  IntArray  st  =  {{{  -1 ,  -2 ,  -3 ,  -4 ,  -5   }, {  -1 ,  -2 ,  -3 ,  -4 ,  -5   }}};
136137        return  st ;
137138    } else  {
138-         struct  IntArray  st  =  {{{0 , 0 , 0 , 0 , 0 }, {0 , 0 , 0 , 0 , 0 }}};
139+         struct  IntArray  st  =  {{{  0 ,  0 ,  0 ,  0 ,  0   }, {  0 ,  0 ,  0 ,  0 ,  0   }}};
139140        return  st ;
140141    }
141142}
@@ -163,10 +164,7 @@ int sum_matrix() {
163164    return  sum ;
164165}
165166
166- int  argc ;
167- char  * * argv ;
168- 
169- int  count_dashes () {
167+ int  count_dashes (int  argc , char  * * argv ) {
170168    char  * * cur  =  argv ;
171169    int  cnt  =  0 ;
172170    while  (argc -- ) {
0 commit comments