Files
Data-Structure/Dev-C++/ExerciseBook/05.21/05.21.cpp
2019-11-15 13:27:08 +08:00

44 lines
833 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include <stdio.h>
#include "Status.h" //**▲01 绪论**//
#include "TSMatrix.h" //**▲05 数组和广义表**//
/*
* 稀疏矩阵加法AddSMatrix
*
*【注】
* 该函数已在TSMatrix相关文件中定义
*/
Status Algo_5_21(TSMatrix A, TSMatrix B, TSMatrix* C);
int main(int argc, char* argv[]) {
TSMatrix A, B, C;
printf("█ 创建两个稀疏矩阵 A、B ...\n");
CreateSMatrix(&A, "TestData_A.txt");
CreateSMatrix(&B, "TestData_B.txt");
printf("█ A = \n");
PrintSMatrix(A);
printf("█ B = \n");
PrintSMatrix(B);
// 矩阵相加
Algo_5_21(A, B, &C);
printf("█ C = A + B = \n");
PrintSMatrix(C);
return 0;
}
/*
* 稀疏矩阵加法AddSMatrix
*
*【注】
* 该函数已在TSMatrix相关文件中定义
*/
Status Algo_5_21(TSMatrix A, TSMatrix B, TSMatrix* C) {
return AddSMatrix(A, B, C);
}