Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://vk.com/evgenykravchenko0
- ___ ___ ___
- / /\ ___ / /\ / /\
- / /:/_ /__/\ / /:/_ / /:/_
- / /:/ /\ \ \:\ / /:/ /\ / /:/ /\
- / /:/ /:/_ \ \:\ / /:/_/::\ / /:/ /:/_
- /__/:/ /:/ /\ ___ \__\:\ /__/:/__\/\:\ /__/:/ /:/ /\
- \ \:\/:/ /:/ /__/\ | |:| \ \:\ /~~/:/ \ \:\/:/ /:/
- \ \::/ /:/ \ \:\| |:| \ \:\ /:/ \ \::/ /:/
- \ \:\/:/ \ \:\__|:| \ \:\/:/ \ \:\/:/
- \ \::/ \__\::::/ \ \::/ \ \::/
- \__\/ ~~~~ \__\/ \__\/
- ___
- /__/\ ___ ___
- \ \:\ / /\ / /\
- \ \:\ / /:/ / /:/
- _____\__\:\ /__/::\ /__/::\
- /__/::::::::\ \__\/\:\__ \__\/\:\__
- \ \:\~~\~~\/ \ \:\/\ \ \:\/\
- \ \:\ ~~~ \__\::/ \__\::/
- \ \:\ /__/:/ /__/:/
- \ \:\ \__\/ \__\/
- \__\/
- #include <stdio.h>
- int main()
- {
- int max = 20;
- int columnA = 3;
- int columnB = 2;
- int lineA = 2;
- int lineB = 3;
- int i;
- int j;
- int m;
- int matrixA[max][max];
- int matrixB[max][max];
- int MultiAB[max][max];
- printf("Матрица A \n");
- for(i = 1;i <= columnA;i++)
- for(j = 1; j <= lineA;j++)
- scanf("%d", &matrixA[i][j]);
- printf("Матрица D \n");
- for(i = 1; i <= columnB;i++)
- for(j = 1; j <= lineB;j++)
- scanf("%d", &matrixB[i][j]);
- for(m = 1; m <= columnA;m++)
- for(j = 1; j<= lineB;j++)
- {
- MultiAB[m][j] = 0;
- for(i = 1;i <= lineA;i++)
- MultiAB[m][j] = MultiAB[m][j] + matrixA[m][i] * matrixB[i][j];
- }
- printf("Матрица A * B \n");
- for(i = 1; i <= columnA;i++)
- {
- for(j = 1;j <= lineB;j++)
- printf(" %d ", MultiAB[i][j]);
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement