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

42 lines
823 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 "CrossList.h" //**▲05 数组和广义表**//
/*
* 稀疏矩阵加法AddSMatrix
*
*【注】
* 该函数已在CrossList相关文件中定义
*/
Status Algo_5_27(CrossList M, CrossList N, CrossList* Q);
int main(int argc, char* argv[]) {
CrossList M, N, Q;
printf("█ 创建两个稀疏矩阵 M、N ...\n");
CreateSMatrix(&M, "TestData_M.txt");
CreateSMatrix(&N, "TestData_N.txt");
printf("█ M = \n");
PrintSMatrix(M);
printf("█ N = \n");
PrintSMatrix(N);
Algo_5_27(M, N, &Q);
printf("█ Q = M + N = \n");
PrintSMatrix(Q);
return 0;
}
/*
* 稀疏矩阵加法AddSMatrix
*
*【注】
* 该函数已在CrossList相关文件中定义
*/
Status Algo_5_27(CrossList M, CrossList N, CrossList* Q) {
return AddSMatrix(M, N, Q);
}