摘要: /*思路:将稀疏矩阵a转置为b,先扫描一遍a三元表(行列值),获得a各列元素个数->得到b各行元素个数->知道a各元素在b中的插入位置->再扫描一遍a即可T(n)=O(Cols+Terms);*/1 const int MaxTerms = 100; 2 class SparseMatrix 3 { 阅读全文
posted @ 2020-10-26 21:22 __小王子 阅读(134) 评论(0) 推荐(0)
摘要: 1.char* c=new char[10]; c[0]='a'; //cout<<strlen(c);输出未知.如果输入用cin时自动添加‘\0’ c[1]='\0';cout<<strlen(c);//1 2.整数加 ‘0’后会隐性的转化为char类型;字符减 ‘0’隐性转化为int类型 //把 阅读全文
posted @ 2020-10-26 18:53 __小王子 阅读(88) 评论(0) 推荐(0)