数据结构 系数矩阵的表示和转置.docVIP

  • 12
  • 0
  • 约2.08千字
  • 约 4页
  • 2018-03-08 发布于河南
  • 举报
数据结构 系数矩阵的表示和转置

实验四 稀疏矩阵的表示和转置 实验人: 学号: 时间: 分析与探讨 附录:源代码 源代码列在附录中,要求程序风格清晰易理解,有充分的注释。有意义的注释行不少于30%。 #includestdio.h #includestdlib.h #define P 4 #define N 5 #define MAXSIZE 100 typedef int ElementType; typedef struct { int row,col; ElementType e; }Triple; typedef struct { Triple data[MAXSIZE+1]; int m,n,len; }TSMatrix; void InitMatrix(int A[P+1][N+1])//初始化矩阵 { int i,j; printf(请输入一个4行5列的矩阵:\n); for(i=1;i=P;i++) { for(j=1;j=N;j++) { scanf(%d,A[i][j]); } } for(i=1;iP+1;i++) { for(j=1;jN+1;j++) { printf(%d\t,A[i][j]); } printf(\n); } printf(\n); } TSMatrix MatrixToTriple(i

文档评论(0)

1亿VIP精品文档

相关文档