Created
April 7, 2017 04:29
-
-
Save VictorSouzas/d787877d250cf940e463ff4e53e928af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define size 1000 | |
int main(){ | |
int i,j,k; | |
double aux = 0; | |
static double A[size][size]; | |
static double B[size][size]; | |
static double C[size][size]; | |
for (i = 0; i < size; ++i) | |
{ | |
for (j = 0; j < size; ++j) | |
{ | |
A[i][j] = 0.5; | |
} | |
} | |
for (i = 0; i < size; ++i) | |
{ | |
for (j = 0; j < size; ++j) | |
{ | |
B[i][j] = 2.0; | |
} | |
} | |
// A line | |
for (i = 0; i < size; ++i) | |
{ | |
// B column | |
for (j = 0; j < size; ++j) | |
{ | |
// B line | |
for (k = 0; k < size; ++k) | |
{ | |
aux += A[i][k] * B[k][j]; | |
} | |
C[i][j] = aux; | |
aux = 0; | |
} | |
} | |
/* | |
for (i = 0; i < size; ++i) | |
{ | |
for (j = 0; j < size; ++j) | |
{ | |
printf("%.2f\t", C[i][j]); | |
} | |
printf("\n"); | |
} | |
*/ | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment