Skip to content

Commit c5121e2

Browse files
authored
Update 06.c
1 parent 4880573 commit c5121e2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lista2/06.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include <stdio.h>
22

3-
#define MATRIX_SIZE 2
3+
#define size 2
44

5-
typedef int matrix[MATRIX_SIZE][MATRIX_SIZE];
5+
typedef int matrix[size][size];
66

77
int main(void){
88
matrix x = {{2, 2}, {2, 2}};
@@ -11,16 +11,16 @@ int main(void){
1111

1212
int i, j, k;
1313

14-
for (i = 0; i < MATRIX_SIZE; i++){
15-
for (j = 0; j < MATRIX_SIZE; j++){
16-
for (k = 0; k < MATRIX_SIZE; k++){
14+
for (i = 0; i < size; i++){
15+
for (j = 0; j < size; j++){
16+
for (k = 0; k < size; k++){
1717
resultado[i][j] += x[i][k] * y[k][j];
1818
}
1919
}
2020
}
2121

22-
for (i = 0; i < MATRIX_SIZE; i++){
23-
for (j = 0; j < MATRIX_SIZE; j++){
22+
for (i = 0; i < size; i++){
23+
for (j = 0; j < size; j++){
2424
printf("%d ", resultado[i][j]);
2525
}
2626
printf("\n");

0 commit comments

Comments
 (0)