【c语言】矩阵乘法
1.N*N矩阵
A[N][N]*B[N][N]=C[N][N]
#include<stdio.h>
#define N 2
int main()
{
int A[N][N] = {
}, B[N][N] = {
}, C[N][N] = {
};
printf_s("请输入矩阵A:\n");
int i, j;
for (i = 0; i < N; i++) {
for (j = 0; j < N; j++) {
scanf_s("%d", &A[i][j]);
}
}
printf_s("\n");
printf_s("A[N][N]为:\n");
for (i = 0; i < N; i++) {
for (j = 0; j < N; j++) {
printf_s("%d\t", A[i][j]);
}
printf_s("\n");
}
printf_s("\n"